Skip to content

Commit

Permalink
test ci (#1017)
Browse files Browse the repository at this point in the history
* test ci

* lint

* lint

* sqlalchemy version

* pymysql

* pymysql

* pymysql

* image

* pymysql revert

* remove test

* fix json tests

* snippet tests

* duckdb version
  • Loading branch information
neelasha23 authored Jun 26, 2024
1 parent 0433444 commit f4302dc
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 17 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## 0.10.11dev

* [Feature] Test CI

## 0.10.10 (2024-02-07)

* [Feature] Adds `ploomber-extension` as a dependency
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"twine",
# tests
# DuckDB 0.10.1 breaking Sqlalchemy v1 tests: https://github.com/ploomber/jupysql/issues/1001 # noqa
"duckdb<0.10.1",
"duckdb",
"duckdb-engine",
"pyodbc",
# sql.plot module tests
Expand Down
2 changes: 1 addition & 1 deletion src/sql/_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def get_tmp_dir():
"alias": "mySQLTest",
"docker_ct": {
"name": "mysql",
"image": "mysql",
"image": "mysql:8.0",
"ports": {3306: 33306},
},
"query": {},
Expand Down
22 changes: 11 additions & 11 deletions src/tests/test_magic.py
Original file line number Diff line number Diff line change
Expand Up @@ -2296,11 +2296,11 @@ def test_get_query_type(query, query_type):
[
(
"%sql select '{\"a\": 1}'::json -> 'a';",
"1",
1,
),
(
'%sql select \'[{"b": "c"}]\'::json -> 0;',
'{"b":"c"}',
{"b": "c"},
),
(
"%sql select '{\"a\": 1}'::json ->> 'a';",
Expand All @@ -2314,13 +2314,13 @@ def test_get_query_type(query, query_type):
"""%%sql select '{\"a\": 1}'::json
->
'a';""",
"1",
1,
),
(
"""%%sql select '[{\"b\": \"c\"}]'::json
->
0;""",
'{"b":"c"}',
{"b": "c"},
),
(
"""%%sql select '{\"a\": 1}'::json
Expand All @@ -2338,15 +2338,15 @@ def test_get_query_type(query, query_type):
),
(
"%sql SELECT '{\"a\": 1}'::json -> 'a';",
"1",
1,
),
(
"%sql SELect '{\"a\": 1}'::json -> 'a';",
"1",
1,
),
(
"%sql SELECT json('{\"a\": 1}') -> 'a';",
"1",
1,
),
],
ids=[
Expand Down Expand Up @@ -2377,7 +2377,7 @@ def test_json_arrow_operators(ip, query, expected):
"""%%sql --save snippet
select '{\"a\": 1}'::json -> 'a';""",
"%sql select * from snippet",
"1",
1,
),
(
"""%sql --save snippet select '[{\"b\": \"c\"}]'::json ->> 0;""",
Expand All @@ -2390,7 +2390,7 @@ def test_json_arrow_operators(ip, query, expected):
-> 2
as number""",
"%sql select number from snippet",
"3",
3,
),
],
ids=["cell-magic-key", "line-magic-index", "cell-magic-multi-line-as-column"],
Expand Down Expand Up @@ -2737,11 +2737,11 @@ def test_var_substitution_section(ip_empty, tmp_empty):
[
(
'%sql select json(\'[{"a":1}, {"b":2}]\')',
'[{"a":1},{"b":2}]',
"[{'a': 1}, {'b': 2}]",
),
(
'%sql select \'[{"a":1}, {"b":2}]\'::json',
'[{"a":1}, {"b":2}]',
"[{'a': 1}, {'b': 2}]",
),
],
)
Expand Down
8 changes: 4 additions & 4 deletions src/tests/test_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def __repr__(self) -> str:


def test_boxplot_stats(chinook_db, ip_empty):
# there's some werid behavior in duckdb-engine that will cause the
# there's some weird behavior in duckdb-engine that will cause the
# table not to be found if we call commit
ip_empty.run_cell("%config SqlMagic.autocommit=False")
ip_empty.run_cell("%sql duckdb://")
Expand All @@ -65,7 +65,7 @@ def test_boxplot_stats(chinook_db, ip_empty):


def test_boxplot_stats_exception(chinook_db, ip_empty):
# there's some werid behavior in duckdb-engine that will cause the
# there's some weird behavior in duckdb-engine that will cause the
# table not to be found if we call commit
ip_empty.run_cell("%config SqlMagic.autocommit=False")
ip_empty.run_cell("%sql duckdb://")
Expand Down Expand Up @@ -101,7 +101,7 @@ def test_summary_stats(chinook_db, ip_empty, tmp_empty):
"""
)

# there's some werid behavior in duckdb-engine that will cause the
# there's some weird behavior in duckdb-engine that will cause the
# table not to be found if we call commit
ip_empty.run_cell("%config SqlMagic.autocommit=False")
ip_empty.run_cell("%sql duckdb://")
Expand All @@ -114,7 +114,7 @@ def test_summary_stats(chinook_db, ip_empty, tmp_empty):


def test_summary_stats_missing_file(chinook_db, ip_empty):
# there's some werid behavior in duckdb-engine that will cause the
# there's some weird behavior in duckdb-engine that will cause the
# table not to be found if we call commit
ip_empty.run_cell("%config SqlMagic.autocommit=False")
ip_empty.run_cell("%sql duckdb://")
Expand Down

0 comments on commit f4302dc

Please sign in to comment.