Hi, I am importing the CSV file using the API. The...
# gooddata-cloud
m
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-23T194614,2025-01-23T204442 payload = { "tables": [ { "name": "pod", "source": { "config": { "columnDateFormats": { "MetricTime": "yyyy-MM-dd'T'HHmmss" }, "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'HHmmss" # 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 } } ] }
m
Hi Manuel, Thank you for rewrite the issue in the correct channel. As I can see, you mention you can upload the data by using the UI, and the result is the expected. For that reason I would like to ask if you can try again to do it by UI, or if you can provide a time window when you uploaded the data. With this information I would be able to see the logs and find, probably, the correct Payload. And, finally our apologies for the missing the explicit documentation on How to do it. Thank you
m
Hi Mauricio, Thanks for the response. I just uploaded the data from the UI.(07:06PM UTC)
You can see it detects the two columns as date while uploading from the UI(PFB).