fivetran-data-model-bot
released this
15 Jul 14:56
·
2 commits
to main
since this release
PR #48 includes the following updates:
🚨 Breaking Change 🚨
- Added logic to support user-specified scenarios where the Fivetran Salesforce connector syncs column names using the original Salesforce API naming convention. For example, while Fivetran typically provides the column as
created_date
, some users might choose to receive it asCreatedDate
according to the API naming. This update ensures the package is automatically compatible with both naming conventions.- Specifically, the package now performs a COALESCE, preferring the original Salesforce API naming. If the original naming is not present, the Fivetran version is used instead.
- Renamed columns are now explicitly cast to prevent conflicts during the COALESCE.
- ❗This change is considered breaking since the resulting column types may differ from prior versions of this package.
Under the Hood
- Added the following macros to support the mentioned bug fix logic:
add_renamed_columns
: Determines the original names for each column and adds them to the list generated within eachget_*_columns
macro. By default, this macro processes column names by removing underscores and capitalizing each part that follows an underscore. This ensures all necessary columns are available for use in thecoalesce_rename
macro. Additionally, this macro tags each column with its renamed version to maintain tracking.column_list_to_dict
: Converts the list of dictionaries generated by theget_*_columns
macros into a dictionary of dictionaries for use in thecoalesce_rename
macro. This conversion is necessary so that each column dictionary entry can be accessed by a key, rather than iterating through a list.coalesce_rename
: Utilizes the dictionary generated bycolumn_list_to_dict
to coalesce a column with its renamed counterpart, producing the final column. This macro also allows for the passing of a custom renamed spelling, datatype, and alias as arguments to override default values.
- Added validation test to ensure the final column names generated before and after this update remain the same.
Full Changelog: v1.0.1...v1.1.0