From ea7fd5bd181827902f8718d4d94d3cbcf7682dc9 Mon Sep 17 00:00:00 2001 From: utkarsh sharma Date: Tue, 22 Mar 2022 21:49:17 +0530 Subject: [PATCH] Addressed PR suggestion. --- conftest.py | 6 +++--- tests/operators/test_agnostic_load_file.py | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/conftest.py b/conftest.py index b32c86093..98f64a282 100644 --- a/conftest.py +++ b/conftest.py @@ -65,11 +65,11 @@ def sample_dag(): @pytest.fixture def test_table(request, sql_server): - table_type = True + is_tmp_table = True table_options = {} if getattr(request, "param", None): - table_type = request.param.get("is_temp", True) + is_tmp_table = request.param.get("is_temp", True) table_options = request.param.get("param", {}) sql_name, hook = sql_server @@ -91,7 +91,7 @@ def test_table(request, sql_server): raise ValueError("Unsupported Database") params.update(table_options) - table = TempTable(**params) if table_type else Table(**params) + table = TempTable(**params) if is_tmp_table else Table(**params) yield table diff --git a/tests/operators/test_agnostic_load_file.py b/tests/operators/test_agnostic_load_file.py index 517facdef..ae6601351 100644 --- a/tests/operators/test_agnostic_load_file.py +++ b/tests/operators/test_agnostic_load_file.py @@ -14,6 +14,7 @@ import os import pathlib import unittest.mock +from typing import Union from unittest import mock import pandas as pd @@ -44,7 +45,7 @@ CWD = pathlib.Path(__file__).parent -def get_dataframe_from_table(sql_name: str, test_table: Table, hook): +def get_dataframe_from_table(sql_name: str, test_table: Union[Table, TempTable], hook): if sql_name == "bigquery": client = bigquery.Client() query_job = client.query(