Details
-
Type:
Story
-
Status: In Progress
-
Resolution: Unresolved
-
Fix Version/s: None
-
Component/s: daf_butler
-
Story Points:2
-
Epic Link:
-
Team:Data Release Production
-
Urgent?:No
Description
The Gen3 Registry's implied dimension dependencies (e.g. visit.physical_filter, exposure.visit) are allowed to be None, which translates nicely to NULL in SQL. Unfortunately SQL NULLs and Python Nones compare differently, and we want the latter behavior in SQL queries. That means we need to either
- add special NULL-handling logic to the query-generation code
- do our own mapping from Python None to sentinal values in all fetch/insert code
- drop support for None/NULL in implied dimensions and make the associated foreign key columns in the database NOT NULL to support this.
We've been working around this long enough (by making sure we have sentinal values for concepts like "this exposure has no physical_filter" and "this physical_filter has no band") that I think that's what we should keep doing, and reap the benefits of that by simplifying the butler code that (inconsistently) allowed implied dependencies to be None/NULL. I'm going to give that a try on this ticket, though actually modifying the foreign key constraints to prohibit None/NULL will require a (trivial) migration, and I might punt that to another ticket.