Skip to content

Commit 6576b43

Browse files
fix: address CI lint and test failures
- Fix E501 line too long in schemas.py:529 by breaking up long f-string - Fix ValueError in alter() by unpacking all 8 return values from prepare_declare() (column_comments was added for PostgreSQL support) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 56a8df4 commit 6576b43

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/datajoint/declare.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
"bool": (r"bool$", "tinyint"),
3232
# UUID (stored as binary)
3333
"uuid": (r"uuid$", "binary(16)"),
34-
# JSON
35-
"json": (r"json$", None), # json passes through as-is
34+
# JSON (matches both json and jsonb for PostgreSQL compatibility)
35+
"json": (r"jsonb?$", None), # json/jsonb passes through as-is
3636
# Binary (bytes maps to longblob in MySQL, bytea in PostgreSQL)
3737
"bytes": (r"bytes$", "longblob"),
3838
# Temporal
@@ -651,6 +651,7 @@ def alter(definition: str, old_definition: str, context: dict, adapter) -> tuple
651651
index_sql,
652652
external_stores,
653653
_fk_attribute_map,
654+
_column_comments,
654655
) = prepare_declare(definition, context, adapter)
655656
(
656657
table_comment_,
@@ -660,6 +661,7 @@ def alter(definition: str, old_definition: str, context: dict, adapter) -> tuple
660661
index_sql_,
661662
external_stores_,
662663
_fk_attribute_map_,
664+
_column_comments_,
663665
) = prepare_declare(old_definition, context, adapter)
664666

665667
# analyze differences between declarations

src/datajoint/schemas.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,11 @@ def jobs(self) -> list[Job]:
526526
# Iterate over auto-populated tables and check if their job table exists
527527
for table_name in self.list_tables():
528528
adapter = self.connection.adapter
529-
table = FreeTable(self.connection, f"{adapter.quote_identifier(self.database)}.{adapter.quote_identifier(table_name)}")
529+
full_name = (
530+
f"{adapter.quote_identifier(self.database)}."
531+
f"{adapter.quote_identifier(table_name)}"
532+
)
533+
table = FreeTable(self.connection, full_name)
530534
tier = _get_tier(table.full_table_name)
531535
if tier in (Computed, Imported):
532536
# Compute expected job table name: ~~base_name

0 commit comments

Comments
 (0)