8000 Support allow_nan in message JSON output by sgandhi1311 · Pull Request #183 · singer-io/singer-python · GitHub
[go: up one dir, main page]

Skip to content

Support allow_nan in message JSON output#183

Merged
sgandhi1311 merged 4 commits intomasterfrom
SUP-6525-allow-nan
Oct 22, 2025
Merged

Support allow_nan in message JSON output#183
sgandhi1311 merged 4 commits intomasterfrom
SUP-6525-allow-nan

Conversation

@sgandhi1311
Copy link
Member

Description of change

This change updates the format_message and write_message functions to include the allow_nan parameter in the json.dumps call.

  • Added allow_nan=False as a default argument to both functions.
  • Allows callers to control whether non-finite float values (NaN, Infinity, -Infinity) are serialized into JSON.
  • Improves compatibility with JSON consumers that may reject non-finite float values.

Manual QA steps

  • Tested locally and now the connector successfully replicates the non-finite float values.
  • Performed PR-alpha on the customer connection.

Risks

  • None

Rollback steps

  • revert this branch

AI generated code

https://internal.qlik.dev/general/ways-of-working/code-reviews/#guidelines-for-ai-generated-code

  • this PR has been written with the help of GitHub Copilot or another generative AI tool

@sgandhi1311 sgandhi1311 requested a review from Copilot October 16, 2025 10:43
Copy link
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 adds support for controlling NaN and infinite float value serialization in JSON output by adding an allow_nan parameter to message formatting functions.

  • Added allow_nan=False parameter to format_message and write_message functions
  • Enables callers to control serialization of non-finite float values (NaN, Infinity, -Infinity)
  • Improves JSON compatibility with consumers that reject non-finite values

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@vishalp-dev
Copy link
Member

Can we add tests for this?

@sgandhi1311 sgandhi1311 merged commit ccf2266 into master Oct 22, 2025
3 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

0