Hi everyone! I’m using the python SDK as part of a...
# advice-metadata-modeling
b
Hi everyone! I’m using the python SDK as part of a pipeline that parses metadata from form inputs. e.g.: • Form question “Select your job title from the following:“; options = “Engineer”, “Analyst”, “Manager” • User selection is saved under
job_title
in database • Expected:
SchemaFieldClass
where
label = "Select your job title from the following:"
,
fieldPath = "job_title"
, and
type = EnumTypeClass
or
type = UnionTypeClass
The datahub frontend is a big part of our use case. Is there a way to: 1. Capture the possible values of
Engineer, Analyst, Manager
within the the schemaField so that the values can be clearly viewed in the UI? 2. Able to track changes to possible values, as well as the
label
, as part of the Technical Schema (ie. frontend users can see historic changes through the UI)? Thanks so much in advance - big fan of the product!
a
Are you using
Enum
here? Would you be so kind as to file a github issue? Also what version are you on?
b
I’m using
v0.9.6.1
and I’ve tried Enum and Union, but neither would display the possible values in the UI. Likewise for the label. My workaround is to put those values in the description field, but unfortunately that means changes are not captured in the Technical Schema.
example:
Copy code
job_title_enum = SchemaFieldClass(
  fieldPath = 'job_title',
  type = SchemaFieldDataTypeClass(type=EnumTypeClass()),
  nativeDataType = "Dropdown", 
  description = "Question: **Select your job title from the following:**\n\nPossible Values:\n- `'Engineer'`\n- `'Analyst'`\n- `'Manager'`",
  label = "Select your job title from the following:",
  jsonProps = json.dumps({'default_values': ['Engineer', 'Analyst', 'Manager']})
)

job_title_union = copy.copy(job_title_enum)
job_title_union.type = SchemaFieldDataTypeClass(type=UnionTypeClass(nestedTypes=['Engineer', 'Analyst', 'Manager']))
For sure, will file a github issue!