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

Pin Pandas version and move back to native to_sql #1053

Merged
merged 2 commits into from
Feb 29, 2024

Conversation

akmiller01
Copy link
Contributor

No description provided.

Copy link

sonarcloud bot commented Feb 28, 2024

Quality Gate Passed Quality Gate passed

Issues
2 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

)
)

flat_transaction_data.to_sql(name=TMP_DATA_TABLENAME, con=conn, schema=DATA_SCHEMA, index=False, if_exists="append")
Copy link
Contributor

Choose a reason for hiding this comment

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

Won't this create a very long sql statement?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Won't this create a very long sql statement?

It was the way all our Python scripts worked before SQL alchemy got updated from v1 to v2. Pandas v1 was incompatible with SQL alchemy v2. The batching function I wrote to replace pandas to_sql ended up taking about 5x as long to run as the original. To the point where large updates would take ~30 hours.

So we need to update Python from 3.7 to 3.8, in order to pull in pandas v2 and get the original fast to_sql back. It does smart batching.

Copy link
Contributor

Choose a reason for hiding this comment

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

If it does batching, we good.

@akmiller01 akmiller01 merged commit a81e0d8 into develop Feb 29, 2024
7 checks passed
@akmiller01 akmiller01 deleted the feature/update-pandas branch February 29, 2024 15:21
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.

None yet

2 participants