-
Notifications
You must be signed in to change notification settings - Fork 400
Closed
Labels
enhancementNew feature or requestNew feature or requesttech-debtLeftovers from previous work. Should be fixed over timeLeftovers from previous work. Should be fixed over time
Description
Documentation description
A lot of arguments in the dlt.extract.hints.DltResourceHints.apply_hints function are actually optional, but it's not wrapped with typing.Optional,
making some static linter, such as ruff/pyrefly, mark it as an error if we're providing a None value to it.
Example usecase: I want to set incremental hints based on certain condition
resource.apply_hints(incremental=incremental if condition is True else None,)Lines 444 to 457 in 7b6f8c4
| table_name: TTableHintTemplate[str] = None, | |
| parent_table_name: TTableHintTemplate[str] = None, | |
| write_disposition: TTableHintTemplate[TWriteDispositionConfig] = None, | |
| columns: TTableHintTemplate[TAnySchemaColumns] = None, | |
| primary_key: TTableHintTemplate[TColumnNames] = None, | |
| merge_key: TTableHintTemplate[TColumnNames] = None, | |
| incremental: TIncrementalConfig = None, | |
| schema_contract: TTableHintTemplate[TSchemaContract] = None, | |
| additional_table_hints: Optional[Dict[str, TTableHintTemplate[Any]]] = None, | |
| table_format: TTableHintTemplate[TTableFormat] = None, | |
| file_format: TTableHintTemplate[TFileFormat] = None, | |
| references: TTableHintTemplate[TTableReferenceParam] = None, | |
| create_table_variant: bool = False, | |
| nested_hints: TTableHintTemplate[Dict[TTableNames, TResourceNestedHints]] = None, |
Let me know if this is not intentional. I can create a PR for this. Thanks for the great library!
Are you a dlt user?
Yes, I'm already a dlt user.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requesttech-debtLeftovers from previous work. Should be fixed over timeLeftovers from previous work. Should be fixed over time
Type
Projects
Status
Done