-
Notifications
You must be signed in to change notification settings - Fork 94
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
[BUG] #519
Comments
@guilhermedelyra thanks so much for reporting! Acutally prefect-fugue needs refactoring because it was designed before a major refactoring of Fugue. After the fix on the prefect-fugue side, the experience should be even simpler: import pandas as pd
import fugue.api as fa
from prefect import task, flow
@task
def load_data():
return pd.read_parquet("https://d37ci6vzurychx.cloudfront.net/trip-data/green_tripdata_2022-01.parquet")
@flow
def run_sql(top, engine):
data = load_data()
with fa.engine_context(engine):
fa.fugue_sql_flow("""
SELECT PULocationID, COUNT(*) AS ct FROM df
GROUP BY 1 ORDER BY 2 DESC LIMIT 2
PRINT
""", data)
run_sql(1, "spark") # your current spark session (not recommended)
run_sql(1, "prefect_fugue/<spark_block>") # using the config in your prefect block to connect to remote spark/databricks |
that's really nice to know 🙂 Is there anything I can do to help? |
@guilhermedelyra for this one, this is a long due change, and I just made it. Thanks for raising this problem. If you are interested in contributing to either the prefect-fugue or the fugue project, please let us know. We can discuss on slack channel. Thanks! |
@guilhermedelyra we have released prefect-fugue 0.0.3, and you can find instruction here: fugue-project/prefect-fugue#10 Please let us know if you have any question or feedbacks. Thanks |
thank you very much! 🙂 |
Minimal Code To Reproduce
Describe the bug
"ImportError: ord() expected string of length 1, but int found. Please try to install the package by
pip install fugue[sql]
."Full log:
Already reinstalled, but the error keeps on happening
Expected behavior
Basically the same as the tutorial: https://fugue-tutorials.readthedocs.io/tutorials/integrations/ecosystem/prefect.html#running-sql-on-any-spark-dask-and-duckdb
Environment (please complete the following information):
packages installed:
Pip freeze:
The text was updated successfully, but these errors were encountered: