Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix csv_import data argument type#11

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
1pxone merged 1 commit intomainfromfix/import_csv_data_argument_type
Jun 11, 2025
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletionsREADME.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -644,7 +644,7 @@ Imports records from CSV data.
def import_csv(
self,
label: str,
csv_data: Union[str, bytes],
data:str,
options: Optional[Dict[str, bool]] = None,
transaction: Optional[Transaction] = None
) -> List[Dict[str, Any]]
Expand All@@ -653,7 +653,7 @@ def import_csv(
**Arguments:**

- `label` (str): Label for imported records
- `csv_data` (Union[str, bytes]): CSV data to import
- `data` (Union[str, bytes]): CSV data to import
- `options` (Optional[Dict[str, bool]]): Import options
- `transaction` (Optional[Transaction]): Optional transaction object

Expand All@@ -665,14 +665,14 @@ def import_csv(

```python
# Import records from CSV
csv_data = """name,age,department,role
data = """name,age,department,role
John Doe,30,Engineering,Senior Engineer
Jane Smith,28,Product,Product Manager
Bob Wilson,35,Engineering,Tech Lead"""

records = db.records.import_csv(
label="EMPLOYEE",
csv_data=csv_data,
data=data,
options={"returnResult": True, "suggestTypes": True}
)
```
Expand Down
2 changes: 1 addition & 1 deletionpyproject.toml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "rushdb"
version = "1.5.0"
version = "1.5.1"
description = "RushDB Python SDK"
authors = ["RushDB Team <hi@rushdb.com>"]
license = "Apache-2.0"
Expand Down
8 changes: 4 additions & 4 deletionssrc/rushdb/api/records.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -499,7 +499,7 @@ def find(
def import_csv(
self,
label: str,
csv_data: Union[str, bytes],
data:str,
options: Optional[Dict[str, bool]] = None,
transaction: Optional[Transaction] = None,
) -> List[Dict[str, Any]]:
Expand All@@ -511,8 +511,8 @@ def import_csv(

Args:
label (str): The label/type to assign to all records created from the CSV.
csv_data (Union[str, bytes]): The CSV content to import. Can be provided
as a string or bytes object.
data (Union[str, bytes]): The CSV content to import. Can be provided
as a string.
options (Optional[Dict[str, bool]], optional): Configuration options for the import operation.
Available options:
- returnResult (bool): Whether to return the created records data. Defaults to True.
Expand DownExpand Up@@ -541,7 +541,7 @@ def import_csv(

payload = {
"label": label,
"data":csv_data,
"data":data,
"options": options or {"returnResult": True, "suggestTypes": True},
}

Expand Down
4 changes: 2 additions & 2 deletionstests/test_create_import.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -200,12 +200,12 @@ def test_transaction_rollback(self):

def test_import_csv(self):
"""Test importing data from CSV"""
csv_data = """name,age,department,role,salary
data = """name,age,department,role,salary
John Doe,30,Engineering,Senior Engineer,120000
Jane Smith,28,Product,Product Manager,110000
Bob Wilson,35,Engineering,Tech Lead,140000"""

self.client.records.import_csv("EMPLOYEE",csv_data)
self.client.records.import_csv("EMPLOYEE",data)

def test_search_result_integration(self):
"""Test SearchResult integration with find operations"""
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp