|
3 | 3 |
|
4 | 4 | import contextlib |
5 | 5 | import os |
6 | | -import random |
7 | | -import string |
8 | 6 |
|
9 | 7 | import pytest |
10 | | -from past.builtins.misc import xrange |
11 | 8 |
|
12 | 9 | from pyathenajdbc import connect |
13 | | -from tests.util import Env, read_query |
14 | | - |
15 | | -ENV = Env() |
16 | | -BASE_PATH = os.path.dirname(os.path.abspath(__file__)) |
17 | | -S3_PREFIX = "test_pyathena_jdbc" |
18 | | -WORK_GROUP = "test-pyathena-jdbc" |
19 | | -SCHEMA = "test_pyathena_jdbc_" + "".join( |
20 | | - [random.choice(string.ascii_lowercase + string.digits) for i in xrange(10)] |
21 | | -) |
| 10 | +from tests import BASE_PATH, ENV, S3_PREFIX, SCHEMA |
| 11 | +from tests.util import read_query |
22 | 12 |
|
23 | 13 |
|
24 | 14 | @pytest.fixture(scope="session", autouse=True) |
@@ -54,12 +44,24 @@ def _create_table(cursor): |
54 | 44 | location_one_row_complex = "{0}{1}/{2}/".format( |
55 | 45 | ENV.s3_staging_dir, S3_PREFIX, "one_row_complex" |
56 | 46 | ) |
| 47 | + location_partition_table = "{0}{1}/{2}/".format( |
| 48 | + ENV.s3_staging_dir, S3_PREFIX, "partition_table" |
| 49 | + ) |
| 50 | + location_integer_na_values = "{0}{1}/{2}/".format( |
| 51 | + ENV.s3_staging_dir, S3_PREFIX, "integer_na_values" |
| 52 | + ) |
| 53 | + location_boolean_na_values = "{0}{1}/{2}/".format( |
| 54 | + ENV.s3_staging_dir, S3_PREFIX, "boolean_na_values" |
| 55 | + ) |
57 | 56 | for q in read_query(os.path.join(BASE_PATH, "sql", "create_table.sql")): |
58 | 57 | cursor.execute( |
59 | 58 | q.format( |
60 | 59 | schema=SCHEMA, |
61 | 60 | location_one_row=location_one_row, |
62 | 61 | location_many_rows=location_many_rows, |
63 | 62 | location_one_row_complex=location_one_row_complex, |
| 63 | + location_partition_table=location_partition_table, |
| 64 | + location_integer_na_values=location_integer_na_values, |
| 65 | + location_boolean_na_values=location_boolean_na_values, |
64 | 66 | ) |
65 | 67 | ) |
0 commit comments