Skip to content
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

Refactor: Sparkle Writers should be initialized inside class #20

Closed
farbodahm opened this issue Oct 2, 2024 · 3 comments · Fixed by #23
Closed

Refactor: Sparkle Writers should be initialized inside class #20

farbodahm opened this issue Oct 2, 2024 · 3 comments · Fixed by #23
Milestone

Comments

@farbodahm
Copy link
Collaborator

farbodahm commented Oct 2, 2024

In the current interface for Sparkle, we are passing Writers as writers: List[Writer]. it should be refactored to writers: List[type[Writer]], similar to readers argument.

Regarding type List[type[Writer]], it can be refactored to an Enum; So instead of List[type[Writer]], we accept List[WriterType] which WriterType is an enum. Same should happen for reader. (Created #24 another issue)

Reason is initiaizing a Writer requires a SparkSession which we decided to let Sparkle create that session; So it means during initializing a Sparkle app, we don't have access to SparkSession yet and Sparkle should be responsible for initializing Readers and Writers.

@farbodahm farbodahm added this to the v1 milestone Oct 2, 2024
@wtfzambo
Copy link
Contributor

wtfzambo commented Oct 2, 2024

@farbodahm didn't we suggest in our call to instead of passing writers: List[type[Writer]], to use some kind of Enum or TypedDict instead, to hide implementation away from final user and avoid unnecessary imports?

@farbodahm
Copy link
Collaborator Author

@wtfzambo That's a different story. I updated description of this issue to also include that.

@farbodahm
Copy link
Collaborator Author

@wtfzambo I created #24 to address that issue; For now I would prefer to keep it like this and continue developing Damavand to have something working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants