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

Use exclude keyword in dict method to exclude Action callable field #142

Merged
merged 1 commit into from
Jul 22, 2022

Conversation

grahamalama
Copy link
Contributor

@grahamalama grahamalama commented Jul 22, 2022

As a follow-on to #139 (which addresses #136 and #137):

The model config approach we used in d46eb39 seemed to help with the /powered_by_jbi endpoint, but errors were still appearing in /whiteboard_tags.

We found that using the action.dict(exclude=<...>) method seemed to actually exclude the callable field. (pydantic docs)

It's unclear at this point why this method works and the model config approach doesn't.

@grahamalama grahamalama requested a review from a team as a code owner July 22, 2022 17:47
Copy link
Contributor

@bsieber-mozilla bsieber-mozilla left a comment

Choose a reason for hiding this comment

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

LGTM; minor comment added.

Thanks for looking into this

src/app/api.py Outdated Show resolved Hide resolved
The model config approach we used in d46eb39 seemed to help with the
`/powered_by_jbi` endpoint, but we were still seeing failures in
`/whiteboard_tags`.

We found that using the .dict(exclude=<...>) method seemed to _acutally_
exclude the `callable` field.
@grahamalama grahamalama merged commit ee66832 into main Jul 22, 2022
@grahamalama grahamalama deleted the exclude-callable-in-dict branch July 22, 2022 17:57
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