artitionKey.get(part) AttributeError: 'str' object has no attribute 'get'

Mahesh K 1 Reputation point
2021-05-19T17:44:39.767+00:00

I am reading csv using pandas pd.read_csv method...and then loading the data to cosmos db:

without converting the df to json obj...it is generating error saying 'wrong obj passed'...then i used json.dumps(data_dict) to convert it to json obj...but now it is saying below error:

return self._retrieve_partition_key(partition_key_parts, document, is_system_key)
File "C:\ProgramData\Anaconda3\lib\site-packages\azure\cosmos_cosmos_client_connection.py", line 2539, in _retrieve_partition_key
partitionKey = partitionKey.get(part)
AttributeError: 'str' object has no attribute 'get' 97900-csv-to-cosmos.txt

Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,643 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.