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

Add ability to load into spark dataframe #4

Merged
merged 5 commits into from
Dec 21, 2023
Merged

Conversation

tomcarter23
Copy link
Member

@tomcarter23 tomcarter23 commented Dec 20, 2023

Add the ability to load a dataset straight into a spark dataframe

Copy link
Contributor

@simonhkswan simonhkswan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One request and one comment for suggestion. Thanks for adding this!

src/synthesized_datasets/_datasets.py Show resolved Hide resolved
@@ -51,6 +55,14 @@ def load(self) -> _pd.DataFrame:
df.attrs["name"] = self.name
return df

def load_spark(self, spark: _ps.SparkSession) -> _ps.DataFrame:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are your thoughts on making spark an optional kwarg in load? When passed in it returns a spark dataframe, otherwise a pandas one is returned.

Copy link
Contributor

@simonhkswan simonhkswan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice addition :D

src/synthesized_datasets/_datasets.py Show resolved Hide resolved
@tomcarter23 tomcarter23 merged commit 55feb67 into master Dec 21, 2023
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 this pull request may close these issues.

2 participants