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

Improve handling of CSV source fields. #89

Merged
merged 1 commit into from
Mar 12, 2024
Merged

Conversation

HuwCampbell
Copy link
Collaborator

We're hit by Terraform SDK Issue 258
here, which causes the elements of the nested structure to be
filled in even if it's not set in the record. This is a very
unfortunate part of the SDK.

Becase the map contains the empty string unconditionally and
we can't use GetOk like we could on the top level, we have to
check if the string is empty instead.

For boolean fields, we can't even do this properly, as it's
always false or true, so our optional elements in the Schema
will always be set, fortunately the Spark options will still
do the right thing here.

We're hit by [Terraform SDK Issue 258](hashicorp/terraform-plugin-sdk#258)
here, which causes the elements of the nested structure to be
filled in even if it's not set in the record. This is a very
unfortunate part of the SDK.

Becase the map contains the empty string unconditionally and
we can't use GetOk like we could on the top level, we have to
check if the string is empty instead.

For boolean fields, we can't even do this properly, as it's
always false or true, so our optional elements in the Schema
will always be set, fortunately the Spark options will still
do the right thing here.
@HuwCampbell HuwCampbell merged commit 1e6e184 into master Mar 12, 2024
1 check passed
@HuwCampbell HuwCampbell deleted the topic/csv-options branch March 12, 2024 02:21
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 this pull request may close these issues.

1 participant