Skip to content

Commit

Permalink
Merge branch 'main' into edgarrmondragon/chore/refactors-typos-cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon committed Sep 23, 2024
2 parents 9da58a5 + d07b415 commit dffba58
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
8 changes: 2 additions & 6 deletions target_postgres/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,11 +310,7 @@ def pick_individual_type(self, jsonschema_type: dict): # noqa: PLR0911
return ARRAY(self.to_sql_type({"type": items_type}))

# Case 3: tuples
if isinstance(items, list):
return ARRAY(JSONB())

# All other cases, return JSONB
return JSONB()
return ARRAY(JSONB()) if isinstance(items, list) else JSONB()

# string formats
if jsonschema_type.get("format") == "date-time":
Expand Down Expand Up @@ -398,7 +394,7 @@ def create_empty_table( # type: ignore[override] # noqa: PLR0913
raise RuntimeError(
f"Schema for table_name: '{table_name}'"
f"does not define properties: {schema}"
)
) from None

for property_name, property_jsonschema in properties.items():
is_primary_key = property_name in primary_keys
Expand Down
2 changes: 1 addition & 1 deletion target_postgres/sinks.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def schema_name(self) -> str | None:
"""Return the schema name or `None` if using names with no schema part.
Note that after the next SDK release (after 0.14.0) we can remove this
as it's already up-streamed.
as it's already implemented upstream.
Returns:
The target schema name.
Expand Down

0 comments on commit dffba58

Please sign in to comment.