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

protected in config is always true #1608

Open
dali-rmw opened this issue Dec 8, 2023 · 3 comments · May be fixed by #1718
Open

protected in config is always true #1608

dali-rmw opened this issue Dec 8, 2023 · 3 comments · May be fixed by #1718

Comments

@dali-rmw
Copy link

dali-rmw commented Dec 8, 2023

Hello,
Setting "protected: false" is ignored, and it consistently behaves as if it were true.
image

image
@BenBirt
Copy link
Collaborator

BenBirt commented Dec 11, 2023

Thanks for filing this issue.

Just to be clear - it looks like protected: false is only ignored in the part of the framework which performs config block validation (https://github.com/dataform-co/dataform/blob/main/core/session.ts#L142).

Obviously the trivial workaround is to simply remove the line - because this is the default.

However, we should definitely fix this! We should probably just replace sqlxConfig.hasOwnProperty("protected") with sqlxConfig.protected.

@dali-rmw
Copy link
Author

Hello,
thank you for your reply. I understand that it's initially set to false by default. However, for my specific scenario, I need to dynamically set it using JavaScript.

@BenBirt
Copy link
Collaborator

BenBirt commented Dec 11, 2023

Okay, makes sense. In that case I would either:

  1. Not use SQLX (and thus avoid this check), i.e. use JavaScript entirely
  2. Send us a PR to do the suggestion above (I'd be happy to then immediately publish that change in a new @dataform/core version)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants