Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Add BigQuery row to dictionary conversion in list #176

Merged
merged 6 commits into from
May 23, 2023

Conversation

davidschrooten
Copy link
Contributor

When using prefect-gcp you are forced to use pandas dataframe when using a task runner such as Ray or Dask. These task runners pickle the objects, but with large rows it can result in a maximum recursion depth exceeded exception, when you're using lists with Bigquery Row objects. This PR implements a optional row_as_dict argument. It also contains one minor typing hint fix. As the bigquery_query function also supports the return of a pandas dataframe.

@davidschrooten davidschrooten requested a review from a team April 24, 2023 14:04
Copy link
Member

@desertaxle desertaxle left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution @davidschrooten! I have a suggestion for a more extensible way to introduce result transformation. Let me know what you think. Once we've agreed on an approach, it'd also be ideal to have some tests covering the new functionality.

prefect_gcp/bigquery.py Outdated Show resolved Hide resolved
Copy link
Member

@desertaxle desertaxle left a comment

Choose a reason for hiding this comment

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

This is looking good to me. One comment on the docstring. You can fix the static analysis errors by running pre-commit install && pre-commit run --all and committing the chagnes.

prefect_gcp/bigquery.py Outdated Show resolved Hide resolved
@desertaxle desertaxle merged commit 4de3dba into PrefectHQ:main May 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants