Each astra.database.astradb.DataProduct record should refer to a unique file path.
The fields are release, filetype (which set the template to be used by Tree), and kwargs for the data model keywords. The dictionary of kwargs can be stored as a JSONField, but we can't create a unique index on a JSONField. And it gets worse, because similar-looking kwargs could refer to the same path because of how the types are resolved by the Tree product. For example:
If all other fields were the same type and value, kwargs_1 and kwargs_2 would reference the same file path but would be considered unique rows.
We should enforce some kind of checking to make sure that each DataProduct refers only to a unique path, without specifically having to store the path as a field.
Fixed this by forcibly setting the type of each value in DataProduct.kwargs, and specified a unique identifier DataProduct.kwargs_hash which is automatically calculated at creation time.
Each
astra.database.astradb.DataProduct
record should refer to a unique file path.The fields are
release
,filetype
(which set the template to be used byTree
), andkwargs
for the data model keywords. The dictionary ofkwargs
can be stored as aJSONField
, but we can't create a unique index on aJSONField
. And it gets worse, because similar-lookingkwargs
could refer to the same path because of how the types are resolved by theTree
product. For example:If all other fields were the same type and value,
kwargs_1
andkwargs_2
would reference the same file path but would be considered unique rows.We should enforce some kind of checking to make sure that each
DataProduct
refers only to a unique path, without specifically having to store the path as a field.