Skip to content

Commit

Permalink
fix(connector): pull dataframe fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
ArslanSaleem committed Jan 24, 2025
1 parent 148d585 commit 6610d38
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
1 change: 0 additions & 1 deletion pandasai/data_loader/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import hashlib
import importlib
import os
from datetime import datetime, timedelta
from typing import Any, Optional

import pandas as pd
Expand Down
7 changes: 6 additions & 1 deletion pandasai/dataframe/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,12 @@ def pull(self):
dataset_loader = DatasetLoader()
df = dataset_loader.load(self.path)
self.__init__(
df, schema=df.schema, name=df.name, description=df.description, path=df.path
df,
schema=df.schema,
data_loader=dataset_loader,
name=df.name,
description=df.description,
path=df.path,
)

print(f"Dataset pulled successfully from path: {self.path}")
Expand Down
10 changes: 7 additions & 3 deletions pandasai/dataframe/virtual_dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,18 @@ def __init__(self, *args, **kwargs):
if not schema:
raise VirtualizationError("Schema is required for virtualization!")

table_name = schema.source.table or schema.name
name = kwargs.pop("name", None)

description = schema.description
description = kwargs.pop("description", None)

table_name = schema.source.table or name or schema.name

table_description = description or schema.description

super().__init__(
self.get_head(),
name=table_name,
description=description,
description=table_description,
*args,
**kwargs,
)
Expand Down

0 comments on commit 6610d38

Please sign in to comment.