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

Added a "LIMIT 1" clause to the fetch state query in BigQuery client #2316

Open
wants to merge 6 commits into
base: devel
Choose a base branch
from

Conversation

xneg
Copy link
Contributor

@xneg xneg commented Feb 17, 2025

Description

Added a "LIMIT 1" clause to the fetch state query in BigQuery client since only the first record is used later in the code.

Related Issues

Copy link

netlify bot commented Feb 17, 2025

Deploy Preview for dlt-hub-docs canceled.

Name Link
🔨 Latest commit 0bfc808
🔍 Latest deploy log https://app.netlify.com/sites/dlt-hub-docs/deploys/67b36c063281590008195c78

@sh-rp
Copy link
Collaborator

sh-rp commented Feb 17, 2025

I don't think this will work with all destinations, mssql has a different syntax for example.

@xneg
Copy link
Contributor Author

xneg commented Feb 17, 2025

@sh-rp ah, you are right, thank you! I have to think about different solution.

@xneg
Copy link
Contributor Author

xneg commented Feb 17, 2025

I couldn't think anything better than moving "LIMIT 1" clause to specific BigQuery client.

@xneg xneg changed the title Added a "LIMIT 1" clause to the fetch state query Added a "LIMIT 1" clause to the fetch state query in BigQuery client Feb 17, 2025
@sh-rp
Copy link
Collaborator

sh-rp commented Feb 17, 2025

@xneg sorry for not responding in more detail earlier, it just occured to me that we already have a solution for this, albeit not a very elegant one. Check the _limit_clause_sql function that has a special implementation for mssql and how it is used in the datasets. You can just use that to achieve what you want with a 2 line code change. Let me know if you need help.

@sh-rp
Copy link
Collaborator

sh-rp commented Feb 17, 2025

Additional thought: you might also want to apply this to get_stored_schema, the same problem could arise.

@xneg
Copy link
Contributor Author

xneg commented Feb 17, 2025

@sh-rp Thank you! It's good idea although a bit more than 2 lines of code. And thank you for hint with get_stored_schema, I applied changes there too.

@sh-rp sh-rp added the ci from fork run ci workflows on a pr even if they are from a fork label Feb 18, 2025
@rudolfix
Copy link
Collaborator

@sh-rp ci from fork label does not work in this repo :/ we only have it implemented on verified sources. so to test it we would need to change our workflows...

@sh-rp
Copy link
Collaborator

sh-rp commented Feb 18, 2025

@rudolfix I added ci from fork to our workflows a year ago or so and it is still there, but it does not work for some reason...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci from fork run ci workflows on a pr even if they are from a fork
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unstable behaviour while fetching the pipeline state from BigQuery
3 participants