Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

made change to test of str #4463

Merged
merged 2 commits into from
Dec 13, 2021
Merged

made change to test of str #4463

merged 2 commits into from
Dec 13, 2021

Conversation

McKnight-42
Copy link
Contributor

@McKnight-42 McKnight-42 commented Dec 9, 2021

resolves #4433

Description

redefined status param of SQLQueryStatus to typecheck. string which passes on ._message value of AdapterResponse or the str value sent by adapter plugin.

Worked with Nate going through process of dealing with issues as they come in with minimal context, talked through several potential ways to solve the issue and even found some that would cause a bigger change than currently needed so had to take into account what might be worth time investment of task.

-- Co Author @nathaniel-may

Checklist

  • I have signed the CLA
  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • I have updated the CHANGELOG.md and added information about my change

@nathaniel-may
Copy link
Contributor

The other alternative we considered was to have the status field of SQLQueryStatus take a value of type Union[AdapterResponse, str] and do the to string logic inside the event module. However, we would have had to move the definition of the AdapterResponse class to avoid circular imports, and override the asdict method to make json serialization work for AdapterResponse values. Since the plan is to eventually enforce the get_response method to return an AdapterResponse, such that we could rely on calling ._message, making the more complex change didn't seem worth it for the short term.

__str__ is appropriately defined for AdapterResponse so calling str at the call site is both simple and a graceful way to handle this for a patch in v1.0.1.

Copy link
Contributor

@nathaniel-may nathaniel-may left a comment

Choose a reason for hiding this comment

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

Let's just add a changelog entry before we merge.

@McKnight-42 McKnight-42 merged commit 76f7bf9 into main Dec 13, 2021
@McKnight-42 McKnight-42 deleted the McKnight-42/get_response-str branch December 13, 2021 17:55
@leahwicz
Copy link
Contributor

@McKnight-42 this change will need to be backported to the 1.0.latest branch. If you need help with that, let me know

@McKnight-42
Copy link
Contributor Author

@leahwicz would love to set up time to walk through that process

McKnight-42 added a commit that referenced this pull request Dec 13, 2021
* made change to test of str

* changelog update
McKnight-42 added a commit that referenced this pull request Dec 13, 2021
* made change to test of str

* changelog update
iknox-fa pushed a commit that referenced this pull request Feb 8, 2022
* made change to test of str

* changelog update

automatic commit by git-black, original commits:
  76f7bf9
  b3039fd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CORE-15] SQLQueryStatus event expects get_response to return AdapterResponse object only
3 participants