Skip to content

[Issue #12485][Python Client] and [Issue #12486][Python Client]#12487

Closed
tsturzl wants to merge 3 commits intoapache:masterfrom
tsturzl:master
Closed

[Issue #12485][Python Client] and [Issue #12486][Python Client]#12487
tsturzl wants to merge 3 commits intoapache:masterfrom
tsturzl:master

Conversation

@tsturzl
Copy link
Contributor

@tsturzl tsturzl commented Oct 25, 2021

(If this PR fixes a github issue, please add Fixes #<xyz>.)

Fixes #12485
Fixes #12486

Motivation

I found several issues in the python client. First there were some None checks which were too inclusive and didn't allow the use of 0 values for numeric types as well as some other odd behaviors. Secondly JsonSchema did not allow a Record to be used more than once since it deleted fields which wouldn't exist on the second use.

Modifications

  1. Fix None checks.
  2. Improved formatting to comply with Python's PEP 8 Styling Guide
  3. Fix reusing Records with JsonSchema. Copy out data before modifying it. Check keys before deleting.

Verifying this change

  • Make sure that the change passes the CI checks.

(Please pick either of the following options)

This change is a trivial rework / code cleanup without any test coverage.

(or)

This change is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

  • The Python Client has no test coverage currently

Does this pull request potentially affect one of the following parts:

If yes was chosen, please highlight the changes

  • Dependencies (does it add or upgrade a dependency): (yes / no)
  • The public API: (yes / no)
  • The schema: (yes / no / don't know)
  • The default values of configurations: (yes / no)
  • The wire protocol: (yes / no)
  • The rest endpoints: (yes / no)
  • The admin cli options: (yes / no)
  • Anything that affects deployment: (yes / no / don't know)

Documentation

Check the box below and label this PR (if you have committer privilege).

Need to update docs?

  • doc-required

    (If you need help on updating docs, create a doc issue)

  • no-need-doc

    These changes don't change how you use the client, they just fix the behavior to be more inline with what would be expected

  • doc

    (If this PR contains doc changes)

@eolivelli
Copy link
Contributor

@tsturzl:Thanks for your contribution. For this PR, do we need to update docs?
(The PR template contains info about doc, which helps others know more about the changes. Can you provide doc-related info in this and future PR descriptions? Thanks)

@eolivelli
Copy link
Contributor

@tsturzl:Thanks for your contribution. For this PR, do we need to update docs?
(The PR template contains info about doc, which helps others know more about the changes. Can you provide doc-related info in this and future PR descriptions? Thanks)

@eolivelli eolivelli added doc-not-needed Your PR changes do not impact docs and removed doc-label-missing labels Oct 25, 2021
@eolivelli
Copy link
Contributor

@tsturzl:Thanks for providing doc info!

def get_state(self, key):
"""get the value of a given key in the managed state"""
pass
"""Interface defining information available at process time"""
Copy link
Contributor

Choose a reason for hiding this comment

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

The re-indent and changes to " vs ' should be in a different PR.

We should have one commit that just fixed the single problem described.

@merlimat
Copy link
Contributor

Fixes #12485
Fixes #12486

@tsturzl Thanks for the fixes. Ideally, we try to always have different fixes in different PRs, to make the review process easier.

@tsturzl tsturzl closed this Oct 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-not-needed Your PR changes do not impact docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python Client, JsonSchema encoding is not idempotent Python Client has very unexpected behavior, cannot use any value that evaludates to False

3 participants