Skip to content

Commit

Permalink
Handle none capability
Browse files Browse the repository at this point in the history
  • Loading branch information
steinitzu committed Oct 14, 2023
1 parent 0ce5866 commit d30f46b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dlt/normalize/normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ def _get_load_storage(file_format: TLoaderFileFormat) -> LoadStorage:
file_format = destination_caps.preferred_loader_file_format or destination_caps.preferred_staging_file_format
if storage := load_storages.get(file_format):
return storage
supported_formats = list(set(destination_caps.supported_loader_file_formats) | set(destination_caps.supported_staging_file_formats))
# TODO: capabilities.supporteed_*_formats can be None, it should have defaults
supported_formats = list(set(destination_caps.supported_loader_file_formats or []) | set(destination_caps.supported_staging_file_formats or []))
if file_format not in supported_formats:
if file_format == "parquet": # Give users a helpful error message for parquet
raise TerminalValueError((
Expand Down

0 comments on commit d30f46b

Please sign in to comment.