blaze / blaze/odo

odo behavior w.r.t. existing database table

Open
#348 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1k
Forks
131
PR merge metrics
No merged PRs in 30d

Description

Observed below behaviors:
1. When there's already a table in database with the same name as url target table, but with a different table structure, odo neither complain nor actually modify the table; At least one should happen?
2. Try to drop the existing table first does not help; a bug?

```
tUrl = 'sqlite:///./myfile.db::test'
t1=[('col_a', 'a10'),('col_c', 'a20')]
t2=[('col_a', 'a10'),('col_b', 'a20'),('col_c', 'a20')]

# table 'test' already exists, with structure same as t1
df = pd.DataFrame(np.zeros((0,),dtype=t2))
odo(df, tUrl) #nothing happens???

# drop the table first does not help, table with new structure won't be created
try:
drop(tUrl)
except ValueError:
pass
odo(df, tUrl) #nothing created ???
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the two cases using the provided sqlite URL, DataFrame definitions, odo(df, tUrl), and drop(tUrl) calls. Trace how odo handles an existing table and how drop affects the target, then verify that a mismatched table is either reported or updated and that the dropped table is recreated with the new structure.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, sqlite
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.