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

Fix bug in collectionToMaps #3581

Merged
merged 3 commits into from
May 15, 2024
Merged

Conversation

edwardfeng-db
Copy link
Contributor

@edwardfeng-db edwardfeng-db commented May 15, 2024

Changes

  • As mentioned in this thread, there is a bug with collectionToMaps
  • The reason is that in collectionToMap, in the callback function we pass into iterFields, we are not handling the case where a list schema's Elemis a*schema.Schema`.
  • This PR basically takes the block in the callback function in StructToData into collectionToMaps

Tests

  • Tested by executing the failing unit test on the mentioned PR, verified it works
  • make test run locally
  • relevant change in docs/ folder
  • covered with integration tests in internal/acceptance
  • relevant acceptance tests are passing
  • using Go SDK

@codecov-commenter
Copy link

codecov-commenter commented May 15, 2024

Codecov Report

Attention: Patch coverage is 37.50000% with 5 lines in your changes are missing coverage. Please review.

Project coverage is 82.54%. Comparing base (ff8f028) to head (ccc2d12).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3581      +/-   ##
==========================================
- Coverage   82.55%   82.54%   -0.02%     
==========================================
  Files         187      187              
  Lines       19156    19160       +4     
==========================================
+ Hits        15815    15816       +1     
- Misses       2413     2414       +1     
- Partials      928      930       +2     
Files Coverage Δ
common/reflect_resource.go 80.56% <37.50%> (-0.34%) ⬇️

@edwardfeng-db edwardfeng-db requested review from mgyucht and nkvuong May 15, 2024 09:40
@edwardfeng-db edwardfeng-db marked this pull request as ready for review May 15, 2024 09:40
@edwardfeng-db edwardfeng-db requested review from a team as code owners May 15, 2024 09:40
Copy link
Contributor

@nkvuong nkvuong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: should leave a comment on this behaviour for future reference

Copy link
Contributor

@mgyucht mgyucht left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a unit test for this? Otherwise LGTM

@edwardfeng-db edwardfeng-db added this pull request to the merge queue May 15, 2024
Merged via the queue into main with commit 81a8969 May 15, 2024
5 checks passed
@edwardfeng-db edwardfeng-db deleted the edwardfeng-db/fix-collection-to-maps branch May 15, 2024 16:03
hectorcast-db added a commit that referenced this pull request May 23, 2024
### New Features and Improvements

 * Fix bug in collectionToMaps ([#3581](#3581)).
 * Added `databricks_enhanced_security_monitoring_workspace_setting ` resource for ESC (Enhanced Compliance and Security) settings ([#3563](#3563)).
 * Added `databricks_automatic_cluster_update_workspace_setting` resource ([#3444](#3444)).
 * Add databricks_compliance_security_profile_workspace_setting resource ([#3564](#3564)).
 * Make customizable error logs more readable ([#3583](#3583)).
 * Fix control run state failures for `databricks_job` resource ([#3585](#3585)).
 * Added support for popular column types for `resource_sql_table` ([#3528](#3528)).
 * Modify state upgrader to remove `ebs_volume_iops` set to zero ([#3601](#3601)).
 * Add route optimized option to model serving terraform ([#3572](#3572)).
 * Rename lakehouse monitor to quality monitor ([#3584](#3584)).

### Documentation Changes
 * Fix documentation for `databricks_storage_credential` and `databricks_external_location` data sources ([#3588](#3588)).

### Exporter
 * Add support for `databricks_mws_permission_assignment` resource ([#3562](#3562)).
 * Don't list directories in the incremental mode ([#3569](#3569)).

### Internal Changes
 * Add TestMwsAccServicePrincipalResourceOnAws to flaky tests ([#3580](#3580)).

### Dependency updates
 * Bump github.com/databricks/databricks-sdk-go from 0.40.1 to 0.41.0 ([#3604](#3604)).
 * Bump github.com/hashicorp/terraform-plugin-sdk/v2 from 2.33.0 to 2.34.0 ([#3594](#3594)).
@hectorcast-db hectorcast-db mentioned this pull request May 23, 2024
github-merge-queue bot pushed a commit that referenced this pull request May 23, 2024
* Release v1.45.0

### New Features and Improvements

 * Fix bug in collectionToMaps ([#3581](#3581)).
 * Added `databricks_enhanced_security_monitoring_workspace_setting ` resource for ESC (Enhanced Compliance and Security) settings ([#3563](#3563)).
 * Added `databricks_automatic_cluster_update_workspace_setting` resource ([#3444](#3444)).
 * Add databricks_compliance_security_profile_workspace_setting resource ([#3564](#3564)).
 * Make customizable error logs more readable ([#3583](#3583)).
 * Fix control run state failures for `databricks_job` resource ([#3585](#3585)).
 * Added support for popular column types for `resource_sql_table` ([#3528](#3528)).
 * Modify state upgrader to remove `ebs_volume_iops` set to zero ([#3601](#3601)).
 * Add route optimized option to model serving terraform ([#3572](#3572)).
 * Rename lakehouse monitor to quality monitor ([#3584](#3584)).

### Documentation Changes
 * Fix documentation for `databricks_storage_credential` and `databricks_external_location` data sources ([#3588](#3588)).

### Exporter
 * Add support for `databricks_mws_permission_assignment` resource ([#3562](#3562)).
 * Don't list directories in the incremental mode ([#3569](#3569)).

### Internal Changes
 * Add TestMwsAccServicePrincipalResourceOnAws to flaky tests ([#3580](#3580)).

### Dependency updates
 * Bump github.com/databricks/databricks-sdk-go from 0.40.1 to 0.41.0 ([#3604](#3604)).
 * Bump github.com/hashicorp/terraform-plugin-sdk/v2 from 2.33.0 to 2.34.0 ([#3594](#3594)).

* fixes
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.

4 participants