Skip to content

Commit

Permalink
fix(duckdb): skip nulls inside array for array_join() (#157)
Browse files Browse the repository at this point in the history
This is how Athena handles them.
  • Loading branch information
mikix authored Dec 11, 2023
1 parent 77eeca5 commit 05f52f3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cumulus_library/databases.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,12 @@ def insert_tables(self, tables: dict[str, pyarrow.Table]) -> None:
self.connection.register(name, table)

@staticmethod
def _compat_array_join(value: Optional[list[str]], delimiter: str) -> Optional[str]:
def _compat_array_join(
value: Optional[list[Optional[str]]], delimiter: str
) -> Optional[str]:
if value is None:
return None
return delimiter.join(value)
return delimiter.join(v for v in value if v is not None)

@staticmethod
def _compat_date(
Expand Down

0 comments on commit 05f52f3

Please sign in to comment.