Hi, I am importing the CSV file using the API. The upload fails with this exception : {"title":"Bad Request","status":400,"detail":"Import failed for the following files
\nstaging/b30e8fab44eb4dd397b1f1305ff49cd9 An error has occurred while reading contents of 'convert' options: No type alias for date","traceId":"0176170189aaabc50d4eaee5ec2214bb"}
It does not allow to upload the data with date type. Only with string type I could upload the data. But I want MetricTime to be set with data type date to plot the charts. Please advise.
I referred this
documentation for the payload. This is the data I am uploading. Same data while uploading from the UI, it detects as date and get uploaded correctly. But from the API it failed. If I changed the "type": "date" to "type": "string" and remove the columnDateFormats prop, it works.
However keeping the date as string is not helping us to plot the charts in the dashboard. Please help.
CSV Data:
Environment,last_modified,MetricTime
euequ,2025-01-23T19
4614,2025-01-23T20
4442
payload = {
"tables": [
{
"name": "pod",
"source": {
"config": {
"columnDateFormats": {
"MetricTime": "yyyy-MM-dd'T'HH
mmss"
},
"convertOptions": {
"autoDictEncode": True,
"autoDictMaxCardinality": 0,
"checkUtf8": True,
"columnTypes": [
{
"name": "Environment",
"nullable": True,
"type": "string"
},
{
"name": "last_modified",
"nullable": True,
"type": "date", # Assuming 'last_modified' is a date/time field
# "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}
[0 9]{2}[0-9]{2}$" # Regex for ISO 8601
},
{
"name": "MetricTime",
"nullable": True,
"type": "date",
# "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}
[0 9]{2}[0-9]{2}$" # Regex for ISO 8601
}
],
"timestampParsers": [
"yyyy-MM-dd'T'HH
mmss" # ISO 8601 format for last_modified timestamps
]
},
"parseOptions": {
"delimiter": ",",
"doubleQuote": True,
"escapeChar": "\\",
"ignoreEmptyLines": True,
"newlinesInValues": True,
"quoteChar": "\""
},
"readOptions": {
"blockSize": 1000,
"columnNames": ["Environment", "last_modified", "MetricTime"],
"encoding": "UTF-8",
"skipRows": 0,
"skipRowsAfterNames": 0,
"useThreads": True
},
"cdcOptions": {
"incrementalLoad": True,
"changeTrackingColumn": "last_modified", # Column to track changes
"lastProcessedTimestamp": get_last_processed_timestamp(), # Use last processed timestamp
"operationType": "upsert" # Type of operation (insert or update)
}
},
"location": file_uri
}
}
]
}