Skip to content

fix(cur_proxy): Return SQL expression instead of None for CUR2→CUR1 proxy fields#1500

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

fix(cur_proxy): Return SQL expression instead of None for CUR2→CUR1 proxy fields#1500
NithinChandranR-AWS wants to merge 1 commit into
aws-solutions-library-samples:mainfrom
NithinChandranR-AWS:fix/pca-cur2-proxy-none-bug

Conversation

@NithinChandranR-AWS

Copy link
Copy Markdown
Contributor

Problem

get_sql_expression() in cur_proxy.py has an incomplete code path when current_cur_version='2' and target_cur_version='1'. For non-tag fields (e.g. month, year, product_sku), the function falls through without a return, producing Python None which gets interpolated as literal 'None' in SQL.

PCA dashboard is broken for CUR 2.0-only customers.

Fix

After the tag/cost_category loop, look up the field in cur1to2_mapping (CUR1→CUR2 SQL equivalents). If not found, return typed NULL.

Fixes #1498

…roxy fields

get_sql_expression() has an incomplete code path when
current_cur_version='2' and target_cur_version='1'. For fields that
are not resource_tags or cost_category prefixed (e.g. month, year,
product_sku), the function falls through without a return statement,
producing Python None which gets interpolated as the literal string
'None' in SQL queries.

Fix: after the tag loop, look up the field in cur1to2_mapping (which
contains the CUR2 SQL expression for each CUR1 field name). If not
found, return a typed NULL cast.

This fixes PCA dashboard deployment for CUR 2.0-only accounts.

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