Skip to content

fix: cur_proxy returns typed NULL instead of Python None for CUR2→CUR1 proxy fields - #1499

Open
MohamedSherifAbdelsamiea wants to merge 1 commit into
aws-solutions-library-samples:mainfrom
MohamedSherifAbdelsamiea:fix/cur2-to-cur1-proxy-none-bug
Open

fix: cur_proxy returns typed NULL instead of Python None for CUR2→CUR1 proxy fields#1499
MohamedSherifAbdelsamiea wants to merge 1 commit into
aws-solutions-library-samples:mainfrom
MohamedSherifAbdelsamiea:fix/cur2-to-cur1-proxy-none-bug

Conversation

@MohamedSherifAbdelsamiea

Copy link
Copy Markdown

Summary

Fixes Issue 1 from #1498.

When building a CUR1 proxy view from CUR2 data, get_sql_expression() (line ~536-543 in cid/helpers/cur_proxy.py) returned implicit Python None for fields that:

  • Don't have resource_tags_ or cost_category_ prefixes
  • Aren't handled by the existing tag loop

This caused Athena errors: Column 'none' cannot be resolved

Fix

Added after the tag loop:

  1. Lookup in cur1to2_mapping for known CUR2 equivalents
  2. Support for product[] MAP access for product-prefixed fields
  3. Fallback to typed CAST(NULL AS ...) for fields with no equivalent

Testing

  • Deployed CID on a fresh CUR 2.0-only account (no legacy CUR)
  • Before fix: cur1_proxy view creation fails with Column 'none' cannot be resolved
  • After fix: cur1_proxy view created successfully with proper NULL values

Related

…1 proxy fields

When building a CUR1 proxy view from CUR2 data, get_sql_expression()
returned implicit Python None for fields that don't have tag/cost_category
prefixes and aren't in the cur2to1_mapping. This caused Athena errors:
'Column none cannot be resolved'.

Fix adds:
- Lookup in cur1to2_mapping for known CUR2 equivalents
- Proper product[] MAP access for product_ prefixed fields
- Fallback to typed CAST(NULL AS ...) for fields with no equivalent

Fixes aws-solutions-library-samples#1498
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.

PCA Dashboard incompatible with CUR 2.0 — cur_proxy.py returns Python None + missing columns in default Data Export

1 participant