-
Notifications
You must be signed in to change notification settings - Fork 0
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
calitp-py: to_snakecase should substitute colons #41
Comments
@atvaccaro re: cal-itp/data-infra#1218 (review) Right now I guess we could replace the quotes first and then replace anything non-alphanumeric that remains with |
If/once we do this, we can revert cal-itp/data-infra#1218 and maybe remove the special handling for |
Do we know the original reasoning for different replacement characters?
That's a good idea. |
I don't, but I suspect if we look more at the different places where it's used it might become clearer. I believe it's used in the |
BigQuery cannot load column names that contain colons (
:
). We ran into this with theAirtableToWarehouse
operator:google.api_core.exceptions.BadRequest: 400 POST https://bigquery.googleapis.com/bigquery/v2/projects/cal-itp-data-infra/datasets/airtable/tables?prettyPrint=false: Invalid field name "product:_graas". Fields must contain only letters, numbers, and underscores, start with a letter or underscore, and be at most 300 characters long.
The column names in that operator are pre-processed with
to_snakecase
, but the list of punctuation to replace into_snakecase
is manually specified and does not include colons: https://github.com/cal-itp/calitp-py/blob/main/calitp/sql.py#L153We should add colons to this list.
Things to check:
to_snakecase
? It would be desirable for Airtable but I'm not sure about other locationsThe text was updated successfully, but these errors were encountered: