dataform icon indicating copy to clipboard operation
dataform copied to clipboard

protected in config is always true

Open dali-rmw opened this issue 2 years ago • 3 comments

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

image

dali-rmw avatar Dec 08 '23 23:12 dali-rmw

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.

BenBirt avatar Dec 11 '23 13:12 BenBirt

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.

dali-rmw avatar Dec 11 '23 14:12 dali-rmw

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)

BenBirt avatar Dec 11 '23 15:12 BenBirt