Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to import dataframe #188

Open
Rvv1296 opened this issue Jan 1, 2025 · 2 comments
Open

Not able to import dataframe #188

Rvv1296 opened this issue Jan 1, 2025 · 2 comments
Assignees
Labels
question Further information is requested

Comments

@Rvv1296
Copy link

Rvv1296 commented Jan 1, 2025

I am trying to import data frame into the collection that i have already created, but the data is not getting imported into the collection.
I am using following code:

with client.batch.dynamic() as batch:
for index, row in df1.iterrows():
properties = {
"a": row["a"]
}

    batch.add_object(
        collection="test1",
        properties=properties
    )

Here, I am not getting anything in collection.

a = client.collections.get("test1")
aggregation = a.aggregate.over_all(total_count=True)
print(aggregation.total_count)

here it is total count is 0.

can anyone please help me in this.

@erika-cardenas
Copy link
Member

Hi @Rvv1296, thanks for opening up the issue!

Can you tell me which notebook you're following along so I can help?

Here is a snippet for batch importing from the docs:

data_rows = [
    {"title": f"Object {i+1}"} for i in range(5)
]

collection = client.collections.get("MyCollection")

with collection.batch.dynamic() as batch:
    for data_row in data_rows:
        batch.add_object(
            properties=data_row,
        )

@erika-cardenas erika-cardenas self-assigned this Jan 2, 2025
@erika-cardenas erika-cardenas added the question Further information is requested label Jan 2, 2025
@erika-cardenas
Copy link
Member

Hi @Rvv1296, just wanted to check in. Were you able to solve the problem? I'll close this out in a few days if you don't need further help. 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants