-
Notifications
You must be signed in to change notification settings - Fork 12
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
[BigQuery] fqtn is not valid if project name contains '-' #49
Comments
@amirbtb Thanks for opening this issue and using the package! Nice find on my lazy regex. I'll get a patch out tonight to loosen the logic to unblock you. Will ping you here in a bit when it's ready to go. |
@amirbtb i raised the PR above to fix this for you. This loosens the logic of what constitutes a "valid" fqtn. If my testing is correct, it should support your project with dashes. Admittedly, I swung the pendulum pretty far in the other direction in this regex change. I'm sure we'll need to ratchet it back down in the future, but getting you unblocked tonight feels like a better north star than writing regex that will conquer the unknown. We'll shoot to get a new version out tomorrow, but I pushed an alpha that you can access now if you want to test it out: Let us know if you run into any other issues 🍻 |
Thank you for this fix (1.0.2a1), it seems that it accepts my project name now but I'm getting another error :
I'm not sure of the cause but the Do you want me to open another issue or is it related ? |
aha! Great find @amirbtb. It looks like we'll need to open up our TableType enum to accept temporary and external tables. All of our initial testing was done on base tables and views in SF and BQ, so I'm not sure if this will break something downstream. I'll do some testing on this today with a goal to support external tables ASAP. Will ping you here when we have a patch ready to test (hoping today). |
Hi @amirbtb thanks for hanging in there. Here's an alpha that should support external tables: |
Hi @griffatrasgo thank you for your quick fixes !
It looks like the values for Location and/or the project ID are lost in the process. |
Hi @amirbtb thanks for sharing. I think Rasgo oughta send you a cake with all this super testing you're doing 😉 I am able to reproduce this locally under only one condition. when I don't include a project or dataset in the credentials class. Maybe this is what you're doing as well? So this does not produce the error:
But this does:
If this is what you're doing, the easy fix is to include your project and dataset in the credentials class when connecting. I don't remember why we made those optional, but it looks like we're missing logic to support when they're not passed. I can go down that rabbiit hole, but do you want to check if the above fix unblocks you? |
Hello @griffatrasgo you are totally right, it works fine when I include the project and dataset in the credentials class. Thanks for the quick fix 👌🏽 ! Initially I didn't want to define the credentials class with project and schema because we use multiple BigQuery databases (1 GCP project = 1 BigQuery database) and multiple datasets. |
Great, I'm glad we got you unblocked @amirbtb. Thanks for explaining your use case, this makes sense. In current state, rasgoql prefers a default connection so it knows where to write views and tables to. Many of our early testers needed to select from certain schemas they only had read access to and write all SQL transforms to a different schema. If you find yourself needing to switch between namespaces mid-project, we do support one way to do this. On a SQLChain, you can use the I'll consider the need to run in multiple namespaces and see if we can build more helpful experiences to support that. If you have ideas, please keep the feedback coming. If it's alright with you, may I consider this issue resolved and close it? |
Yes, sorry @griffatrasgo you unblocked me on the exact issue a couple of days ago. Thank you for taking into account this use case and for the |
Hello,
The fqtn of the table I want to get is following this pattern :
my-awesome-project.schema.table
.I tried to get it using
rql.dataset(fqtn="my-awesome-project.schema.table")
but I get a[ValueError: my-awesome-project.schema.table is not a well-formed fqtn]()
.It seems that the
validate_fqtn()
function is applying this regex\w+\.\w+\.\w+
that isn't accepting my GCP project name pattern.Is there a way to make this work without changing my GCP project name ?
Thank you for this awesome package, I can't wait to try it ! ❤️ 🚀
The text was updated successfully, but these errors were encountered: