Skip to content

fix: Resolve warnings in SQLAlchemy field defs #1963

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

shreve
Copy link
Contributor

@shreve shreve commented Apr 29, 2025

Most notably, Grade.cell_type was defined as an association_proxy in the class, but was later overwritten with a column_property. Because the mapper had already been made aware of the association_proxy, this raised a warning. Grade.max_score also had a similar problem, with a column_property overwriting a regular @​property.

This commit fixes the warnings by replacing the in-class field definitions with field = None.

Additionally, remove duplicate definitions for cell_type_gradecell and cell_type_taskcell.

Fixes #1946

Most notably, Grade.cell_type was defined as an association_proxy in the
class, but was later overwritten with a column_property. Because the
mapper had already been made aware of the association_proxy, this raised
a warning. Grade.max_score also had a similar problem, with a
column_property overwriting a regular @Property.

This commit fixes the warnings by replacing the in-class field
definitions with `field = None`.

Additionally, remove duplicate definitions for `cell_type_gradecell` and
`cell_type_taskcell`.

Fixes jupyter#1946
Copy link
Contributor

Binder 👈 Launch a Binder on branch shreve/nbgrader/issue-1946

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Some code uses constructs that will fail under Python 3.12
2 participants