-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0fe61b3
commit 682e43d
Showing
9 changed files
with
4 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,51 +81,3 @@ def test_handle_if_empty(caplog): | |
src._handle_if_empty(if_empty="fail") | ||
with pytest.raises(SKIP): | ||
src._handle_if_empty(if_empty="skip") | ||
|
||
|
||
# def test_to_csv_append(): | ||
# """Test whether `to_csv()` with the append option writes data of correct shape""" | ||
# driver = "/usr/lib/x86_64-linux-gnu/odbc/libsqlite3odbc.so" | ||
# db_name = "testfile.sqlite" | ||
# server = "localhost" | ||
# source = SQL( | ||
# credentials=dict(driver=driver, db_name=db_name, server=server, user=None) | ||
# ) | ||
|
||
# # Generate test table. | ||
# df = pd.DataFrame({"a": [1, 2], "b": [3, 4]}) | ||
# source.create_table("test", dtypes={"a": "INT", "b": "INT"}, if_exists="replace") | ||
# source.insert_into(TABLE, df) | ||
|
||
# # Write the table to a CSV three times in `append` mode. | ||
# for i in range(3): | ||
# source.to_csv(path=PATH, query="SELECT * FROM test", if_exists="append") | ||
|
||
# # Read the CSV and validate no. of rows and columns. | ||
# out_df = pd.read_csv(PATH, sep="\t") | ||
|
||
# target_length = 3 * df.shape[0] | ||
# target_width = df.shape[0] | ||
|
||
# actual_length = out_df.shape[0] | ||
# actual_width = out_df.shape[1] | ||
|
||
# assert actual_length == target_length and actual_width == target_width | ||
|
||
# # Clean up. | ||
# os.remove(PATH) | ||
|
||
|
||
# GitHub changes the string and makes the test fail | ||
# def test_conn_str(): | ||
# s = SQL( | ||
# driver=CREDENTIALS["driver"], | ||
# server=CREDENTIALS["server"], | ||
# db=CREDENTIALS["db_name"], | ||
# user=CREDENTIALS["user"], | ||
# pw=CREDENTIALS["password"], | ||
# ) | ||
# assert ( | ||
# s.conn_str | ||
# == "DRIVER=ODBC Driver 17 for SQL Server;SERVER=s123.database.windows.net;DATABASE=a-b-c;UID={[email protected]};PWD={a123;@4}" | ||
# ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters