Allow inline_records to inline optional properties? #5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Currently,
inline_records -p prop::pid_proptakes a record, takes itsprop(if it can be found, lines 20-23) and does dictionary lookup for itspid_prop(line 28). This produces an error whenpid_propis not available.datalink/query-rse-group@04cfed5fc7/query_rse_group/inline_records.py (L20-L28)Consider a class such as Delegation for which both
objectandrolesare optional, but both are good candidates for inlining. These would be two example objects:Because of the above,
inline_records -p delegation::object -p delegation::roleswould produce error for the second record.I would propose that the inlining should not produce an error if
pid_propis not found, similar to how it does not produce error if the entirepropis not found. In other words, it should doprop.get("pid_prop")and check whether the result is (not) None.I would also propose to either make this the only behavior, or make it optional by introducing
-p prop::?pid_propnotation (the?meaning that missingpid_propshould be ignored). The latter is a little bit more complex to implement, but doable.If the behavior change is desired, I would be happy to submit a PR for a preferred version.
Makes sense!
Which of the two options - do that always, or with
prop::?pid_propnotation?