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

DataRecord cannot support field names that have the same name as one of its members #71

Open
mdr223 opened this issue Jan 22, 2025 · 0 comments

Comments

@mdr223
Copy link
Collaborator

mdr223 commented Jan 22, 2025

The DataRecord class currently has the following __setattr__ implementation:

def __setattr__(self, name: str, value: Any, /) -> None:
    if name in ["schema", "field_types", "field_values", "source_id", "parent_id", "cardinality_idx", "passed_operator", "id"]:
        super().__setattr__(name, value)
    else:
        self.field_values[name] = value

For example, if a user has a Schema with a field with the name id, __setattr__ will update the DataRecord's member id rather than the field_values. This will then cause an exception to be thrown if/when there is an attempt to access the id value.

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

No branches or pull requests

1 participant