:py:mod:`rhino_health.lib.endpoints.data_schema.data_schema_dataclass` ====================================================================== .. py:module:: rhino_health.lib.endpoints.data_schema.data_schema_dataclass Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: rhino_health.lib.endpoints.data_schema.data_schema_dataclass.SchemaField rhino_health.lib.endpoints.data_schema.data_schema_dataclass.SchemaFields rhino_health.lib.endpoints.data_schema.data_schema_dataclass.DataSchemaCreateInput rhino_health.lib.endpoints.data_schema.data_schema_dataclass.DataSchema .. py:class:: SchemaField(**data: Any) Bases: :py:obj:`pydantic.BaseModel` A schema field .. !! processed by numpydoc !! .. py:attribute:: name :type: str .. py:attribute:: identifier :type: Optional[str] .. py:attribute:: description :type: Optional[str] .. py:attribute:: role :type: Optional[str] .. py:attribute:: type :type: Optional[str] .. py:attribute:: type_params :type: Any .. py:attribute:: units :type: Optional[str] .. py:attribute:: may_contain_phi :type: Optional[bool] .. py:attribute:: permissions :type: Optional[str] .. py:class:: SchemaFields(schema_fields: List[Dict]) Bases: :py:obj:`pydantic.RootModel` List-like dataclass that provides some convenience functions Pydantic v2 uses RootModel to handle internal things required for serialization .. !! processed by numpydoc !! .. py:property:: field_names .. py:attribute:: root :type: List[Any] .. py:method:: dict(*args, **kwargs) .. py:method:: to_csv(output_file) :abstractmethod: @autoai False .. !! processed by numpydoc !! .. py:class:: DataSchemaCreateInput(**data) Bases: :py:obj:`BaseDataSchema` Input for creating a new DataSchema .. rubric:: Examples >>> DataSchemaCreateInput( >>> name="My DataSchema", >>> description="A Sample DataSchema", >>> primary_workgroup_uid=project.primary_workgroup_uid, >>> project=project.uid, >>> file_path="/absolute/path/to/my_schema_file.csv" >>> ) .. !! processed by numpydoc !! .. py:attribute:: schema_fields :type: List[str] :value: [] A list of rows representing the schema fields from a csv file. Users are recommended to use file_path instead of directly setting this value The first row should be the field names in the schema. Each list string should have a newline at the end. Each row should have columns separated by commas. .. !! processed by numpydoc !! .. py:attribute:: file_path :type: Optional[str] Path to a `CSV `_ File that can be opened with python's built in `open() `_ command. .. !! processed by numpydoc !! .. py:attribute:: primary_workgroup_uid :type: typing_extensions.Annotated[str, Field(alias='primary_workgroup')] The UID of the primary workgroup for this data schema .. !! processed by numpydoc !! .. py:attribute:: project_uid :type: typing_extensions.Annotated[Optional[str], Field(alias='project')] The UID of the project for this data schema .. !! processed by numpydoc !! .. py:attribute:: name :type: str The name of the DataSchema .. !! processed by numpydoc !! .. py:attribute:: description :type: str The description of the DataSchema .. !! processed by numpydoc !! .. py:attribute:: base_version_uid :type: Optional[str] If this DataSchema is a new version of another DataSchema, the original Unique ID of the base DataSchema. .. !! processed by numpydoc !! .. py:attribute:: version :type: Optional[int] :value: 0 The revision of this DataSchema .. !! processed by numpydoc !! .. py:class:: DataSchema(**data) A DataSchema in the system used by Datasets .. !! processed by numpydoc !! .. py:property:: project :type: Project Return the Project Dataclass associated with project_uid .. warning:: The result of this function is cached. Be careful calling this function after making changes. All dataclasses must already exist on the platform before making this call. :Returns: project: Project Dataclass representing the Project .. py:property:: primary_workgroup :type: Workgroup Return the Workgroup Dataclass associated with primary_workgroup_uid .. warning:: The result of this function is cached. Be careful calling this function after making changes. All dataclasses must already exist on the platform before making this call. :Returns: primary_workgroup: Workgroup Dataclass representing the Workgroup .. py:property:: creator :type: User Return the User Dataclass associated with creator_uid .. warning:: The result of this function is cached. Be careful calling this function after making changes. All dataclasses must already exist on the platform before making this call. :Returns: creator: User Dataclass representing the User .. py:attribute:: schema_fields :type: SchemaFields A list of schema fields in this data schema .. !! processed by numpydoc !! .. py:attribute:: uid :type: Optional[str] The Unique ID of the DataSchema .. !! processed by numpydoc !! .. py:attribute:: name :type: str The name of the DataSchema .. !! processed by numpydoc !! .. py:attribute:: description :type: str The description of the DataSchema .. !! processed by numpydoc !! .. py:attribute:: base_version_uid :type: Optional[str] If this DataSchema is a new version of another DataSchema, the original Unique ID of the base DataSchema. .. !! processed by numpydoc !! .. py:attribute:: version :type: Optional[int] :value: 0 The revision of this DataSchema .. !! processed by numpydoc !! .. py:attribute:: creator_uid :type: str The UID of the creator of this dataclass on the system .. !! processed by numpydoc !! .. py:attribute:: created_at :type: str When this dataclass was created on the system .. !! processed by numpydoc !! .. py:attribute:: project_name :type: str The project name .. py:attribute:: primary_workgroup_name :type: str The primary_workgroup name .. py:attribute:: creator_name :type: str The creator name .. py:method:: delete()