Skip to content

fix: remove extra argument causing TypeError in metadata string lists#14

Open
e-kotov wants to merge 1 commit intoOpen-Earth-Monitor:mainfrom
e-kotov:fix/metabase-list-string-init
Open

fix: remove extra argument causing TypeError in metadata string lists#14
e-kotov wants to merge 1 commit intoOpen-Earth-Monitor:mainfrom
e-kotov:fix/metabase-list-string-init

Conversation

@e-kotov
Copy link

@e-kotov e-kotov commented Jan 19, 2026

Hi! I found a small bug that causes a crash when working with metadata fields like keywords or creators.

The Bug

The class _MetaBaseListString tries to pass 3 arguments to its parent class (super().__init__), but the parent class only accepts 2.

This causes a TypeError whenever you try to access or set these fields.

How to Reproduce

You can reproduce this without a Zenodo API key.

The crash happens whenever you access a metadata field that is a "list of strings" (like keywords or creators).

Real World Example:

# This crashes when you try to modify the creators list
dep.metadata.creators.clear()  

Minimal Reproduction (One-Liner):
This one-liner simulates exactly what dep.metadata.keywords does internally:

python -c "from zen.metadata import Metadata; Metadata({'metadata': {}}).keywords"

Result (Before Fix):

TypeError: _MetaBaseList.init() takes from 1 to 3 positional arguments but 4 were given

Result (After Fix):

(No error, exits silently)

The Fix

I simply removed the extra list() argument that was causing the mismatch.

-        super().__init__(data, key, list())
+        super().__init__(data, key)

Thanks for the great library!

The _MetaBaseListString subclass was passing 3 arguments to its parent
_MetaBaseList constructor, which only accepts 2. This caused a TypeError
when accessing metadata fields like keywords or references.
Copilot AI review requested due to automatic review settings January 19, 2026 14:29
Copy link

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

This PR fixes a critical bug in the _MetaBaseListString class that caused a TypeError when accessing metadata fields like keywords or creators. The issue was caused by passing three arguments to the parent class constructor which only accepts two.

Changes:

  • Removed the erroneous third argument list() from the super().__init__() call in _MetaBaseListString.__init__()

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

1 participant

Comments