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

Make LoadStaging.nodegroup nullable #10887

Open
jacobtylerwalls opened this issue May 8, 2024 · 0 comments
Open

Make LoadStaging.nodegroup nullable #10887

jacobtylerwalls opened this issue May 8, 2024 · 0 comments

Comments

@jacobtylerwalls
Copy link
Member

#10885 has a use case for writing LoadStaging records associated with error conditions more generic than any specific nodegroup.

For instance, the JSON-LD parser might have been unable to match a node at all:

raise ValueError(f"Data does not match any actual node, despite prop/class combination {k} {clss}:\n{vi}")

or may have failed very early when validating ontologies:

# Possibly bail very early
if jsonld_document["@type"][0] != self.graphtree["class"]:
raise ValueError("Instance does not have same top level class as model")

In both of these cases, I'm getting around the fact that LoadStaging.nodegroup is not nullable by inserting a random nodegroup, which isn't ideal:

def fallback_nodegroup_id():
"""Consider removing this if we make LoadStaging.nodegroup nullable."""
return Node.objects.filter(nodegroup__isnull=False).first().nodegroup_id

Then, given that tile nodegroups will be nullable in v8, we probably have an additional use case for this.


Suggesting to make LoadStaging.nodegroup nullable and then make sure the db functions account for this when doing their joins to produce error report tables.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🏗 In Progress
Development

No branches or pull requests

1 participant