Skip to content

Commit 07724f4

Browse files
authored
rename focus field (#1346)
* rename focus field * changes for focus * typo * add changelog
1 parent ca1f16b commit 07724f4

File tree

5 files changed

+596
-591
lines changed

5 files changed

+596
-591
lines changed

changes/CHANGELOG-focus.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# What's new in FOCUS Dashboard
22

3+
## FOCUS Dashboard v1.0.1
4+
* Reverted to low case names to avoid issue when Amazon QuickSight does not process CamelCase field names on edit of DataSets.
5+
Recommended update via `cid-cmd update --force --recursive`
6+
37
## FOCUS Dashboard v1.0.0
48
* Add Taxonomy with Resource Tags
59

cid/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1658,7 +1658,7 @@ def create_or_update_dataset(self, dataset_definition: dict, dataset_id: str=Non
16581658
logger.debug(f'dataset {compiled_dataset.get("Name")} resource_tags = {resource_tags}')
16591659
if cur_tags_json_required and resource_tags:
16601660
custom_fields = {
1661-
name: f"parseJson(tags_json, '$.{name}')" # This syntax does not work: $[\"{name}\"]
1661+
name: f"parseJson(tags_json, '$.{name.strip()}')" # This syntax does not work: $[\"{name}\"]
16621662
for name in resource_tags
16631663
}
16641664
logger.debug(f'custom_fields = {custom_fields}')

cid/helpers/quicksight/dashboard_patching.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ def format_field_name(field_name: str, ignore_prefix: bool=False) -> str:
3535
"""
3636
# Handle lowercase strings without underscores by inserting spaces at word boundaries (mainly for focus)
3737
if field_name.islower() and '_' not in field_name:
38-
field_name = re.sub(r'(account|period|discount|unit|price|category|name|id|cost|quantity)', r'_\1', field_name)
38+
field_name = re.sub( r'(zone|id|name|type|category|unit|price|cost|quantity|start|status|class|description|frequency|currency|period)$', r'_\1', field_name)
39+
field_name = re.sub(r'^(availability|billing|charge|commitment|consumed|contracted|effective|invoice|list|pricing|provider|publisher|region|resource|service|sku|sub|tags)', r'\1_', field_name)
3940
# First, handle camelCase by inserting underscores before uppercase letters
4041
field_name = re.sub(r'([a-z])([A-Z])', r'\1_\2', field_name) # This converts "ServiceCode" to "Service_Code"
4142
field_name = field_name.lower()

0 commit comments

Comments
 (0)