Skip to content

Commit 024be59

Browse files
authored
refactor: rename scalars_types_df to scalar_types_df (#1862)
1 parent 6c3f68a commit 024be59

File tree

6 files changed

+23
-23
lines changed

6 files changed

+23
-23
lines changed

tests/unit/core/compile/sqlglot/conftest.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ def _create_compiler_session(table_name, table_schema):
4646

4747

4848
@pytest.fixture(scope="session")
49-
def compiler_session(scalars_types_table_schema):
49+
def compiler_session(scalar_types_table_schema):
5050
"""Compiler session for scalar types."""
51-
return _create_compiler_session("scalar_types", scalars_types_table_schema)
51+
return _create_compiler_session("scalar_types", scalar_types_table_schema)
5252

5353

5454
@pytest.fixture(scope="session")
@@ -72,7 +72,7 @@ def compiler_session_w_json_types(json_types_table_schema):
7272

7373

7474
@pytest.fixture(scope="session")
75-
def scalars_types_table_schema() -> typing.Sequence[bigquery.SchemaField]:
75+
def scalar_types_table_schema() -> typing.Sequence[bigquery.SchemaField]:
7676
return [
7777
bigquery.SchemaField("bool_col", "BOOLEAN"),
7878
bigquery.SchemaField("bytes_col", "BYTES"),
@@ -92,7 +92,7 @@ def scalars_types_table_schema() -> typing.Sequence[bigquery.SchemaField]:
9292

9393

9494
@pytest.fixture(scope="session")
95-
def scalars_types_df(compiler_session) -> bpd.DataFrame:
95+
def scalar_types_df(compiler_session) -> bpd.DataFrame:
9696
"""Returns a BigFrames DataFrame containing all scalar types and using the `rowindex`
9797
column as the index."""
9898
bf_df = compiler_session.read_gbq_table("bigframes-dev.sqlglot_test.scalar_types")
@@ -101,7 +101,7 @@ def scalars_types_df(compiler_session) -> bpd.DataFrame:
101101

102102

103103
@pytest.fixture(scope="session")
104-
def scalars_types_pandas_df() -> pd.DataFrame:
104+
def scalar_types_pandas_df() -> pd.DataFrame:
105105
"""Returns a pandas DataFrame containing all scalar types and using the `rowindex`
106106
column as the index."""
107107
# TODO: add tests for empty dataframes

tests/unit/core/compile/sqlglot/expressions/test_binary_compiler.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,24 @@
1919
pytest.importorskip("pytest_snapshot")
2020

2121

22-
def test_add_numeric(scalars_types_df: bpd.DataFrame, snapshot):
23-
bf_df = scalars_types_df[["int64_col"]]
22+
def test_add_numeric(scalar_types_df: bpd.DataFrame, snapshot):
23+
bf_df = scalar_types_df[["int64_col"]]
2424

2525
bf_df["int64_col"] = bf_df["int64_col"] + bf_df["int64_col"]
2626

2727
snapshot.assert_match(bf_df.sql, "out.sql")
2828

2929

30-
def test_add_numeric_w_scalar(scalars_types_df: bpd.DataFrame, snapshot):
31-
bf_df = scalars_types_df[["int64_col"]]
30+
def test_add_numeric_w_scalar(scalar_types_df: bpd.DataFrame, snapshot):
31+
bf_df = scalar_types_df[["int64_col"]]
3232

3333
bf_df["int64_col"] = bf_df["int64_col"] + 1
3434

3535
snapshot.assert_match(bf_df.sql, "out.sql")
3636

3737

38-
def test_add_string(scalars_types_df: bpd.DataFrame, snapshot):
39-
bf_df = scalars_types_df[["string_col"]]
38+
def test_add_string(scalar_types_df: bpd.DataFrame, snapshot):
39+
bf_df = scalar_types_df[["string_col"]]
4040

4141
bf_df["string_col"] = bf_df["string_col"] + "a"
4242

tests/unit/core/compile/sqlglot/test_compile_concat.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222

2323

2424
def test_compile_concat(
25-
scalars_types_pandas_df: pd.DataFrame, compiler_session: bigframes.Session, snapshot
25+
scalar_types_pandas_df: pd.DataFrame, compiler_session: bigframes.Session, snapshot
2626
):
2727
# TODO: concat two same dataframes, which SQL does not get reused.
2828
# TODO: concat dataframes from a gbq table but trigger a windows compiler.
29-
df1 = bpd.DataFrame(scalars_types_pandas_df, session=compiler_session)
29+
df1 = bpd.DataFrame(scalar_types_pandas_df, session=compiler_session)
3030
df1 = df1[["rowindex", "int64_col", "string_col"]]
3131
concat_df = bpd.concat([df1, df1])
3232
snapshot.assert_match(concat_df.sql, "out.sql")

tests/unit/core/compile/sqlglot/test_compile_filter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
pytest.importorskip("pytest_snapshot")
2020

2121

22-
def test_compile_filter(scalars_types_df: bpd.DataFrame, snapshot):
23-
bf_df = scalars_types_df[["rowindex", "int64_col"]]
22+
def test_compile_filter(scalar_types_df: bpd.DataFrame, snapshot):
23+
bf_df = scalar_types_df[["rowindex", "int64_col"]]
2424
bf_filter = bf_df[bf_df["rowindex"] >= 1]
2525
snapshot.assert_match(bf_filter.sql, "out.sql")

tests/unit/core/compile/sqlglot/test_compile_readlocal.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222

2323

2424
def test_compile_readlocal(
25-
scalars_types_pandas_df: pd.DataFrame, compiler_session: bigframes.Session, snapshot
25+
scalar_types_pandas_df: pd.DataFrame, compiler_session: bigframes.Session, snapshot
2626
):
27-
bf_df = bpd.DataFrame(scalars_types_pandas_df, session=compiler_session)
27+
bf_df = bpd.DataFrame(scalar_types_pandas_df, session=compiler_session)
2828
snapshot.assert_match(bf_df.sql, "out.sql")
2929

3030

tests/unit/core/compile/sqlglot/test_compile_readtable.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
pytest.importorskip("pytest_snapshot")
2020

2121

22-
def test_compile_readtable(scalars_types_df: bpd.DataFrame, snapshot):
23-
snapshot.assert_match(scalars_types_df.sql, "out.sql")
22+
def test_compile_readtable(scalar_types_df: bpd.DataFrame, snapshot):
23+
snapshot.assert_match(scalar_types_df.sql, "out.sql")
2424

2525

2626
def test_compile_readtable_w_repeated_types(repeated_types_df: bpd.DataFrame, snapshot):
@@ -37,13 +37,13 @@ def test_compile_readtable_w_json_types(json_types_df: bpd.DataFrame, snapshot):
3737
snapshot.assert_match(json_types_df.sql, "out.sql")
3838

3939

40-
def test_compile_readtable_w_ordering(scalars_types_df: bpd.DataFrame, snapshot):
41-
bf_df = scalars_types_df[["int64_col"]]
40+
def test_compile_readtable_w_ordering(scalar_types_df: bpd.DataFrame, snapshot):
41+
bf_df = scalar_types_df[["int64_col"]]
4242
bf_df = bf_df.sort_values("int64_col")
4343
snapshot.assert_match(bf_df.sql, "out.sql")
4444

4545

46-
def test_compile_readtable_w_limit(scalars_types_df: bpd.DataFrame, snapshot):
47-
bf_df = scalars_types_df[["int64_col"]]
46+
def test_compile_readtable_w_limit(scalar_types_df: bpd.DataFrame, snapshot):
47+
bf_df = scalar_types_df[["int64_col"]]
4848
bf_df = bf_df.sort_index().head(10)
4949
snapshot.assert_match(bf_df.sql, "out.sql")

0 commit comments

Comments
 (0)