Skip to content

Commit

Permalink
renaming in docs and test with Insert task
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamSulek committed May 24, 2021
1 parent b48fb43 commit 1f45ce1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ The above code pulls data from the API to a pandas `DataFrame`.

## Loading Data to a Source

For creating SQlite database and uploading table with data (pandas DataFrame as input) use LoadDF class.
For creating SQlite database and uploading table with data (pandas DataFrame as input) use Insert class.

```python
from viadot.tasks.sqlite_tasks import LoadDF
table = LoadDF()
table.run(table_name=TABLE_NAME, dtypes=dtypes, db_path=database_path, df=df, if_exists="replace")
from viadot.tasks.sqlite_tasks import Insert
insert = Insert()
insert.run(table_name=TABLE_NAME, dtypes=dtypes, db_path=database_path, df=df, if_exists="replace")
```


Expand Down
8 changes: 4 additions & 4 deletions docs/howtos/run_sql.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
## Loading Data to a Source

For getting pandas DataFrame from sql query use RunSQL class.
For getting pandas DataFrame from sql query use SQLtoDF class.
Get path to database and sql file as an arguments.

```python
from viadot.tasks.sqlite_tasks import RunSQL
runsql = RunSQL(db_path=database_path, sql_path=sql_path)
df_from_task = runsql.run()
from viadot.tasks.sqlite_tasks import SQLtoDF
sql = SQLtoDF(db_path=database_path, sql_path=sql_path)
df_from_task = sql.run()
```
2 changes: 1 addition & 1 deletion tests/prefect/test_tasks_sqlite.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def load_table():

def test_create_table_from_df(load_table):
dtypes = {"country": "VARCHAR(100)", "sales": "FLOAT(24)"}
data = pd.DataFrame({"country": 'italy', "sales": 100.})
df_data = pd.DataFrame({"country": ['italy'], "sales": [100.]})
load = load_table.run(table_name=TABLE,
schema=None,
dtypes=dtypes,
Expand Down

0 comments on commit 1f45ce1

Please sign in to comment.