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

replace-script-table-names fails on EXTRACT(datepart FROM column) #172

Open
seporaitis opened this issue Jan 12, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@seporaitis
Copy link

Describe the bug

Redshift (and other dbms) have an EXTRACT(datepart FROM source) function. Unfortunately, replace-script-table-names interprets the FROM part as a table name, tries to replace it and fails.

To Reproduce
Steps to reproduce the behavior:

  1. Have a model that contains a column that extracts month from a date column: EXTRACT(MONTH FROM date_column) AS just_month.
  2. Run replace-script-table-names pre-commit check, it will fail with an error:
Unable to replace table date_column with ref or source.

Expected behavior
The check should pass.

Version:
v1.2.0

Additional context
N/A

@seporaitis seporaitis added the bug Something isn't working label Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant