Hi, I am importing the CSV file using the API. The...
# gooddata-platform
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. 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, First of all, could you confirm, which product you are using? Please note that this is the channel for our platform edition and, if I am not wrong, your organization is using Cloud edition(?) If you are facing issues in the future can you please post in the correct channel? Nevertheless, can you provide the column headers and first row of the data (can be dummy data) you are trying to import? I am more interested in the data format. In any case, and assuming you are using our Cloud product, the correct payload is in this documentation.
m
Yes Mauricio, We are using the Cloud edition. I referred this same 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. Environment,last_modified,MetricTime euequ,2025-01-23T194614,2025-01-23T204442
m
NOTE: Continuing the discussion on #C04S1MSLEAW channel on this thread: https://gooddataconnect.slack.com/archives/C04S1MSLEAW/p1737748648360149