Skip to content

Hot Fix for Backwards Compatibility of Downloadable Spreadsheet#639

Merged
Bill-Becker merged 4 commits into
masterfrom
develop
Apr 21, 2025
Merged

Hot Fix for Backwards Compatibility of Downloadable Spreadsheet#639
Bill-Becker merged 4 commits into
masterfrom
develop

Conversation

@Bill-Becker
Copy link
Copy Markdown
Collaborator

@Bill-Becker Bill-Becker requested a review from Copilot April 21, 2025 16:07
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a backwards compatibility issue with the downloadable spreadsheet by ensuring that values of type None are handled correctly when performing arithmetic fixes. The changes include:

  • Modifying the safe_get helper to return 0 for None values.
  • Updating key references in the custom table configurations to use the new "Financial" field names.
  • Patching deployment YAML configuration by quoting the maxSurge value for consistency.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
reoptjl/custom_table_helpers.py Updated safe_get to handle None values explicitly.
reoptjl/custom_table_config.py Updated key references from CHP to Financial for cost calculations.
CHANGELOG.md Updated release notes to reflect the hot fix.
.helm/values.production.yaml Corrected YAML formatting by quoting maxSurge value.
Comments suppressed due to low confidence (1)

.helm/values.production.yaml:16

  • Changing maxSurge to a quoted string ensures proper YAML parsing, but please verify that downstream deployment scripts expect this field as a string to avoid potential issues.
    maxSurge: "0%"


def safe_get(df: Dict[str, Any], key: str, default: Any = 0) -> Any:
return df.get(key, default) No newline at end of file
"""Safely get a value from a dictionary with a default fallback."""
Copy link

Copilot AI Apr 21, 2025

Choose a reason for hiding this comment

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

The updated safe_get function now forces a return value of 0 when a key exists with a None value or when default is None. It would be helpful to update the docstring to clearly explain that None is automatically converted to 0 to avoid unintended behavior.

Suggested change
"""Safely get a value from a dictionary with a default fallback."""
"""
Safely get a value from a dictionary with a default fallback.
If the key exists in the dictionary with a value of None, or if the default
value is explicitly set to None, the function will return 0. This ensures
that None values are always converted to 0.
Args:
df (Dict[str, Any]): The dictionary to retrieve the value from.
key (str): The key to look up in the dictionary.
default (Any, optional): The default value to return if the key is not found.
Defaults to 0. If set to None, it will be treated as 0.
Returns:
Any: The value associated with the key, or the default value (converted to 0 if None).
"""

Copilot uses AI. Check for mistakes.
@Bill-Becker Bill-Becker merged commit 5ac66db into master Apr 21, 2025
2 checks passed
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.

2 participants