-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[dagster-powerbi] Move contextual data from DagsterPowerBITranslator to PowerBITranslatorData #26654
base: master
Are you sure you want to change the base?
[dagster-powerbi] Move contextual data from DagsterPowerBITranslator to PowerBITranslatorData #26654
Conversation
Is this every going to cause a recursive explosion of data? I guess we are relying on the fact that That's kind of why I was imagining a container class that holds a reference class PowerBITranslatorData:
content: PowerBIContentData
workspace: PowerBIWorkspaceData As it would make the possibility structurally impossible via the type system. Overall this looks good though. |
cb21360
to
9ab65c3
Compare
Deploy preview for dagster-docs ready! Preview available at https://dagster-docs-mur16xmts-elementl.vercel.app Direct link to changed pages: |
@schrockn in theory, it's not a problem because Currently, That said, after thinking about this, we should not subclass
I updated this PR to make Here's why I think we can move forward with this approach:
|
@@ -78,6 +78,23 @@ class PowerBIContentData: | |||
properties: Dict[str, Any] | |||
|
|||
|
|||
class PowerBITranslatorData(NamedTuple): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can just make this @record
but not serializable to be consistent with the rest of this interface.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 7c63440
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Container class works for me!
22ccf98
to
adf4154
Compare
adf4154
to
88115b1
Compare
Summary & Motivation
This PR implements
PowerBITranslatorData
, a subclass ofPowerBIContentData
, to pass contextual data to the translator without breaking theget_asset_spec
signature or requiring context to be passed to the__init__
method of theDagsterPowerBITranslator
.This is PR is an alternative to the proposals mentioned in #26617.
How I Tested These Changes
Updated tests with BK
Changelog
[dagster-powerbi] Type hints in the signature of
DagsterPowerBITranslator.get_asset_spec
have been updated - the parameterdata
is now of typePowerBITranslatorData
instead ofPowerBIContentData
. Custom Power BI translators should be updated.