You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're using pyright as our type checker. I noticed that pyright does not like the pipeline.run(...)method because the parameter types do not match their default values. For example, destination: TDestinationReferenceArg = None contains a type violation, because None cannot be assigned to TDestinationReferenceArg. We're adding # type: ignore comments to pipeline.run(...) calls because of this.
I also noticed that the runmethod of the SupportsPipeline protocol is currently out of sync with the actual implementation. The same holds true for __call__ in SupportsPipelineRun.
Expected behavior
The solution is to wrap the types of all the named arguments in an Optional, so that None can be passed in by users without any errors from the static type checker.
Pyright: Argument of type "TDestinationReferenceArg | None" cannot be assigned to parameter "destination" of type "TDestinationReferenceArg" in function "run"
Type "TDestinationReferenceArg | None" is not assignable to type "TDestinationReferenceArg"
"None" is not assignable to "TDestinationReferenceArg"
Operating system
macOS
Runtime environment
Local
Python version
3.12
dlt data source
No response
dlt destination
No response
Other deployment details
No response
Additional information
No response
The text was updated successfully, but these errors were encountered:
dlt version
1.7.0
Describe the problem
We're using
pyright
as our type checker. I noticed thatpyright
does not like thepipeline.run(...)
method because the parameter types do not match their default values. For example,destination: TDestinationReferenceArg = None
contains a type violation, becauseNone
cannot be assigned toTDestinationReferenceArg
. We're adding# type: ignore
comments topipeline.run(...)
calls because of this.I also noticed that the
run
method of theSupportsPipeline
protocol is currently out of sync with the actual implementation. The same holds true for__call__
inSupportsPipelineRun
.Expected behavior
The solution is to wrap the types of all the named arguments in an
Optional
, so thatNone
can be passed in by users without any errors from the static type checker.Steps to reproduce
Try to define the following code snippet:
and look for the following warning
Operating system
macOS
Runtime environment
Local
Python version
3.12
dlt data source
No response
dlt destination
No response
Other deployment details
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: