Skip to content

fix: Default to non nullable column for array and object#326

Open
gab23r wants to merge 1 commit intoQuantco:mainfrom
gab23r:array_non_nullable_by_default
Open

fix: Default to non nullable column for array and object#326
gab23r wants to merge 1 commit intoQuantco:mainfrom
gab23r:array_non_nullable_by_default

Conversation

@gab23r
Copy link
Copy Markdown
Contributor

@gab23r gab23r commented Apr 13, 2026

I think is as been missed when merging the PR.
Or maybe it wasn't possible to implement at the time. In any case I don't see why object and array are nullable by default.

This is breaking, how do you want to proceed ?

Copy link
Copy Markdown

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

Note

Copilot was unable to run its full agentic suite in this review.

This PR changes the default nullability for Object and Array columns to be non-nullable by default, addressing the concern that these types currently default to nullable.

Changes:

  • Change Object(..., nullable=...) default from True to False
  • Change Array(..., nullable=...) default from True to False

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
dataframely/columns/object.py Makes Object columns non-nullable by default
dataframely/columns/array.py Makes Array columns non-nullable by default

self,
*,
nullable: bool = True,
nullable: bool = False,
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

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

Changing the default value of a public constructor parameter is a breaking API change that can silently alter existing schemas (call sites that omit nullable will now get NOT NULL). To make this safe and explicit, consider either (1) doing a deprecation cycle (keep default True for now and warn when nullable is omitted for Object/Array, then flip in the next major release), or (2) keep this flip but ensure the release process captures it clearly (changelog entry + major version bump per SemVer) and add migration guidance: 'set nullable=True to keep previous behavior'.

Copilot uses AI. Check for mistakes.
shape: int | tuple[int, ...],
*,
nullable: bool = True,
nullable: bool = False,
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

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

This introduces the same silent-breaking change for Array. Additionally, unless the rest of the column types also default to nullable=False, this will make nullability defaults inconsistent across column classes, which is confusing for API consumers. Consider aligning defaults across column types (preferred) or documenting this special-case rationale prominently in the API docs/migration notes.

Suggested change
nullable: bool = False,
nullable: bool = True,

Copilot uses AI. Check for mistakes.
@gab23r gab23r changed the title fix!: Default to non nullable column for array and object. fix!: Default to non nullable column for array and object Apr 13, 2026
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the fix, this was surely an oversight! Can you still fix the tests?

I think we'll have to mark that as non-breaking as I don't want this to cause v3. It's obviously a bug though.

@borchero Oliver Borchert (borchero) changed the title fix!: Default to non nullable column for array and object fix: Default to non nullable column for array and object Apr 13, 2026
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.

3 participants