-
Notifications
You must be signed in to change notification settings - Fork 427
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
snowflake_file_format update-in-place doesn't apply #2385
Comments
Hey @alexmaras. Thanks for reporting the issue. Could you provide the debug logs ( |
hi @sfc-gh-asawicki - thanks for the response. @justin-ramirez-gametime - the problem seems identical here. Attached are the logs from two applies that happened directly one after the other, both reporting success, with no change in snowflake. tf-output.txt.gz Here is the output from |
Thanks for the logs @alexmaras, @justin-ramirez-gametime. I will analyze this issue this week. |
Hello, We had the same problem; I think I found the issue; created an MR with the fix. |
Any news on this? |
ref #2385 I detected 3 bugs: 1. `d.Get("format_type")` has to be casted first to type `sdk.FileFormatType` in order to be compared with another FileFormatType, if not, the comparison is always `False`. 2. The attribute `comment` was not part of the Update() function 3. The default init value of a pointer is `null`, this means we need to account for this case Apart from that: My trial account expired today and I could not run the Acceptance Tests, but I manually tested it and it seems to work --------- Co-authored-by: Raül Bonet <[email protected]> Co-authored-by: Artur Sawicki <[email protected]>
I have just merged the change @raulbonet mentioned in his previous comment. We plan to release the new version in the middle of the next week (Wednesday or Thursday). |
@alexmaras @justin-ramirez-gametime the aforementioned PR was released as part of 0.86.0. Could you please check if this solves the issue for you? |
hello I'm still facing the same issue in 0.86.0 (tested today) where |
Hello @benriou |
|
Please let me know if you need further details @raulbonet ; thank you |
Thanks, I will have a look later today |
Hello @benriou A singlebyte character string used as the escape character for unenclosed field values only. An escape character invokes an alternative interpretation on subsequent characters in a character sequence. You can use the ESCAPE character to interpret instances of the FIELD_DELIMITER or RECORD_DELIMITER characters in the data as literals. The escape character can also be used to escape instances of itself in the data. Accepts common escape sequences, octal values, or hex values. But If you manually try to execute the statement in Snowflake GUI: And then query the file format: You will see that, indeed, the character has not changed. I tried with other characters, like "A" or "a" and in this case, it gets replaced by |
thank you @raulbonet ; I thought I had to escape the backslashes. This is working like a charm since I configured the field to |
Glad to know it worked! :) |
@alexmaras @justin-ramirez-gametime could you also confirm that it solved your issue, please? |
thanks @sfc-gh-asawicki - I'll check it out tomorrow and report back. |
Hey @sfc-gh-asawicki - The issue I'm hitting now is similar to the above, but I have no way of solving it. I have some file formats defined in Snowflake that have a character as their optional enclosing value - in this case double quotes (
However, if I use |
Thanks @alexmaras , I will have a look tomorrow (EMEA timezone) |
Thanks @raulbonet - I imagine This is the error I'm hitting:
So I guess at the very least, As far as I understand it, any single character (or the keyword |
Hello @alexmaras Anyway, I will create a PR with this small change. |
@sfc-gh-asawicki , I notice a couple of issues here, just bringing it to your attention:
It seems that both seem to work in this case, but not sure if this is the case for absolutely all resources in Snowflake.
I guess we do not want to address this in this PR, but this probably affects all resources. I wonder if we want to account for this use-case or at least track it in the backlog. |
@raulbonet Thanks, I will take a look tomorrow. |
Hey @raulbonet. My answers below: ad 1 ad 2 |
ref #2385 As pointed out by https://github.com/alexmaras , the `validate()` function does not properly validate the use-case where field_optionally_enclosed_by is None. --------- Co-authored-by: Artur Sawicki <[email protected]>
Thanks @raulbonet for helping!
Resolved by #2575 and released in |
@sfc-gh-asawicki version 0.87.1 fixed the issue we were having |
Terraform CLI and Provider Versions
Terraform Configuration
Expected Behavior
Updating a field in the
file_format
resource and re-applying updates the file format in snowflakeActual Behavior
The update does not change anything in snowflake, and terraform picks up the change as needing to be applied every time
Steps to Reproduce
snowflake_file_format
resourceterraform apply
field_optionally_enclosed_by
field for instance (not specific to this field) toNONE
terraform apply
How much impact is this issue causing?
Medium
Logs
No response
Additional Information
Workaround at the moment is to taint the resource in terraform and allow it to be destroyed and recreated.
The text was updated successfully, but these errors were encountered: