The Problem
Currently, the DataSet class in src/intugle/analysis/models.py lacks a user-friendly string representation. When a developer prints a DataSet object, the output is a generic Python object representation (e.g., <intugle.analysis.models.DataSet object at 0x... >), which is not informative for debugging or interactive use.
Proposed Solution
We should implement the __str__ and __repr__ methods on the DataSet class to provide a more descriptive and helpful output.
The representation should include key information about the dataset, such as its name, path, type etc. It might change depending on the connector
Example of desired output:
If its a local filepath:
# After the change, printing the object should look like this:
data_source = {"path": "path/to/my_data.csv", "type": "csv"}
dataset = DataSet(data_source, name="customer_data")
print(dataset)
# Expected output:
# DataSet(name='customer_data' path='path/to/my_data.csv' type='csv')
If its a Snowflake Connector:
# After the change, printing the object should look like this:
data_source = {"identifier": "SNOWFLAKE_DB.SCHEMA.CUSTOMERS", "type": "snowflake"}
dataset = DataSet(data_source, name="customer_data")
print(dataset)
# Expected output:
# DataSet(name='customer_data' identifier='SNOWFLAKE_DB.SCHEMA.CUSTOMERS' type='snowflake')
Files to Modify
src/intugle/analysis/models.py
The Problem
Currently, the
DataSetclass insrc/intugle/analysis/models.pylacks a user-friendly string representation. When a developer prints aDataSetobject, the output is a generic Python object representation (e.g.,<intugle.analysis.models.DataSet object at 0x... >), which is not informative for debugging or interactive use.Proposed Solution
We should implement the
__str__and__repr__methods on theDataSetclass to provide a more descriptive and helpful output.The representation should include key information about the dataset, such as its name, path, type etc. It might change depending on the connector
Example of desired output:
If its a local filepath:
If its a Snowflake Connector:
Files to Modify
src/intugle/analysis/models.py