Skip to content

Commit

Permalink
Merge pull request airbytehq#8 from mohamagdy/destination-redshift-no…
Browse files Browse the repository at this point in the history
…-dbt

Filter out `None` items
  • Loading branch information
mohamagdy authored Apr 8, 2022
2 parents 6f87d6c + f7fedce commit 1dc530b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ COPY destination_redshift_no_dbt ./destination_redshift_no_dbt
ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py"
ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]

LABEL io.airbyte.version=0.1.2
LABEL io.airbyte.version=0.1.3
LABEL io.airbyte.name=airbyte/destination-redshift-no-dbt
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ def get_records(parents: Union[DotMap, List[DotMap]], method: str) -> List[DotMa
if not isinstance(parents, list):
parents = [parents]

parents = list(filter(None, parents))

children_records = []
for parent_item in parents:
children = parent_item.get(method)
Expand All @@ -129,7 +131,6 @@ def get_records(parents: Union[DotMap, List[DotMap]], method: str) -> List[DotMa
if child_item and final_table.references and method == node[-1]:
child_item[final_table.reference_key.name] = parent_item[AIRBYTE_ID_NAME]


children_records.append(child_item)

return children_records
Expand Down

0 comments on commit 1dc530b

Please sign in to comment.