FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
datajoint-python/src/datajoint/types.py at master · hummuscience/datajoint-python · GitHub
hummuscience
datajoint-python
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
datajoint-python
/
src
/
datajoint
/
types.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
60 lines (42 loc) · 1.67 KB
Breadcrumbs
datajoint-python
/
src
/
datajoint
/
types.py
Copy path
File metadata and controls
60 lines (42 loc) · 1.67 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
"""
Type definitions for DataJoint.
This module defines type aliases used throughout the DataJoint codebase
to improve code clarity and enable better static type checking.
Python 3.10+ is required.
"""
from
__future__
import
annotations
from
typing
import
Any
,
TypeAlias
# Primary key types
PrimaryKey
:
TypeAlias
=
dict
[
str
,
Any
]
"""A dictionary mapping attribute names to values that uniquely identify an entity."""
PrimaryKeyList
:
TypeAlias
=
list
[
dict
[
str
,
Any
]]
"""A list of primary key dictionaries."""
# Row/record types
Row
:
TypeAlias
=
dict
[
str
,
Any
]
"""A single row/record as a dictionary mapping attribute names to values."""
RowList
:
TypeAlias
=
list
[
dict
[
str
,
Any
]]
"""A list of rows/records."""
# Attribute types
AttributeName
:
TypeAlias
=
str
"""Name of a table attribute/column."""
AttributeNames
:
TypeAlias
=
list
[
str
]
"""List of attribute/column names."""
# Table and schema names
TableName
:
TypeAlias
=
str
"""Simple table name (e.g., 'session')."""
FullTableName
:
TypeAlias
=
str
"""Fully qualified table name (e.g., '`schema`.`table`')."""
SchemaName
:
TypeAlias
=
str
"""Database schema name."""
# Foreign key mapping
ForeignKeyMap
:
TypeAlias
=
dict
[
str
,
tuple
[
str
,
str
]]
"""Mapping of child_attr -> (parent_table, parent_attr) for foreign keys."""
# Restriction types
Restriction
:
TypeAlias
=
str
|
dict
[
str
,
Any
]
|
bool
|
"QueryExpression"
|
list
|
None
"""Valid restriction types for query operations."""
# Fetch result types
FetchResult
:
TypeAlias
=
list
[
dict
[
str
,
Any
]]
"""Result of a fetch operation as list of dictionaries."""
# For avoiding circular imports
if
False
:
# TYPE_CHECKING equivalent that's always False
from
.
expression
import
QueryExpression
Back
|
FazBrowse Home
|
New Git URL