Skip to content

Commit a3c3478

Browse files
committed
Renaming _getTargetClass to _get_target_class.
Done via: $ git grep -l 'def _getTargetClass(self)' | \ > xargs sed -i s/'def _getTargetClass(self)'/'@staticmethod\n def _get_target_class()'/g
1 parent cd9ac33 commit a3c3478

File tree

99 files changed

+372
-186
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+372
-186
lines changed

bigquery/unit_tests/test__helpers.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,8 @@ def test_w_int64_float64(self):
318318

319319
class Test_ConfigurationProperty(unittest.TestCase):
320320

321-
def _getTargetClass(self):
321+
@staticmethod
322+
def _get_target_class():
322323
from google.cloud.bigquery._helpers import _ConfigurationProperty
323324
return _ConfigurationProperty
324325

@@ -353,7 +354,8 @@ def __init__(self):
353354

354355
class Test_TypedProperty(unittest.TestCase):
355356

356-
def _getTargetClass(self):
357+
@staticmethod
358+
def _get_target_class():
357359
from google.cloud.bigquery._helpers import _TypedProperty
358360
return _TypedProperty
359361

@@ -386,7 +388,8 @@ def __init__(self):
386388

387389
class Test_EnumProperty(unittest.TestCase):
388390

389-
def _getTargetClass(self):
391+
@staticmethod
392+
def _get_target_class():
390393
from google.cloud.bigquery._helpers import _EnumProperty
391394
return _EnumProperty
392395

@@ -419,7 +422,8 @@ def __init__(self):
419422

420423
class Test_UDFResourcesProperty(unittest.TestCase):
421424

422-
def _getTargetClass(self):
425+
@staticmethod
426+
def _get_target_class():
423427
from google.cloud.bigquery._helpers import UDFResourcesProperty
424428
return UDFResourcesProperty
425429

bigquery/unit_tests/test__http.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717

1818
class TestConnection(unittest.TestCase):
1919

20-
def _getTargetClass(self):
20+
@staticmethod
21+
def _get_target_class():
2122
from google.cloud.bigquery._http import Connection
2223
return Connection
2324

bigquery/unit_tests/test_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717

1818
class TestClient(unittest.TestCase):
1919

20-
def _getTargetClass(self):
20+
@staticmethod
21+
def _get_target_class():
2122
from google.cloud.bigquery.client import Client
2223
return Client
2324

bigquery/unit_tests/test_dataset.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717

1818
class TestAccessGrant(unittest.TestCase):
1919

20-
def _getTargetClass(self):
20+
@staticmethod
21+
def _get_target_class():
2122
from google.cloud.bigquery.dataset import AccessGrant
2223
return AccessGrant
2324

@@ -80,7 +81,8 @@ class TestDataset(unittest.TestCase):
8081
PROJECT = 'project'
8182
DS_NAME = 'dataset-name'
8283

83-
def _getTargetClass(self):
84+
@staticmethod
85+
def _get_target_class():
8486
from google.cloud.bigquery.dataset import Dataset
8587
return Dataset
8688

bigquery/unit_tests/test_job.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ def _verifyReadonlyResourceProperties(self, job, resource):
122122
class TestLoadTableFromStorageJob(unittest.TestCase, _Base):
123123
JOB_TYPE = 'load'
124124

125-
def _getTargetClass(self):
125+
@staticmethod
126+
def _get_target_class():
126127
from google.cloud.bigquery.job import LoadTableFromStorageJob
127128
return LoadTableFromStorageJob
128129

@@ -642,7 +643,8 @@ class TestCopyJob(unittest.TestCase, _Base):
642643
SOURCE_TABLE = 'source_table'
643644
DESTINATION_TABLE = 'destination_table'
644645

645-
def _getTargetClass(self):
646+
@staticmethod
647+
def _get_target_class():
646648
from google.cloud.bigquery.job import CopyJob
647649
return CopyJob
648650

@@ -939,7 +941,8 @@ class TestExtractTableToStorageJob(unittest.TestCase, _Base):
939941
SOURCE_TABLE = 'source_table'
940942
DESTINATION_URI = 'gs://bucket_name/object_name'
941943

942-
def _getTargetClass(self):
944+
@staticmethod
945+
def _get_target_class():
943946
from google.cloud.bigquery.job import ExtractTableToStorageJob
944947
return ExtractTableToStorageJob
945948

@@ -1232,7 +1235,8 @@ class TestQueryJob(unittest.TestCase, _Base):
12321235
QUERY = 'select count(*) from persons'
12331236
DESTINATION_TABLE = 'destination_table'
12341237

1235-
def _getTargetClass(self):
1238+
@staticmethod
1239+
def _get_target_class():
12361240
from google.cloud.bigquery.job import QueryJob
12371241
return QueryJob
12381242

bigquery/unit_tests/test_query.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ class TestQueryResults(unittest.TestCase):
2323
QUERY = 'select count(*) from persons'
2424
TOKEN = 'TOKEN'
2525

26-
def _getTargetClass(self):
26+
@staticmethod
27+
def _get_target_class():
2728
from google.cloud.bigquery.query import QueryResults
2829
return QueryResults
2930

bigquery/unit_tests/test_schema.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717

1818
class TestSchemaField(unittest.TestCase):
1919

20-
def _getTargetClass(self):
20+
@staticmethod
21+
def _get_target_class():
2122
from google.cloud.bigquery.schema import SchemaField
2223
return SchemaField
2324

bigquery/unit_tests/test_table.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ class TestTable(unittest.TestCase, _SchemaBase):
3535
DS_NAME = 'dataset-name'
3636
TABLE_NAME = 'table-name'
3737

38-
def _getTargetClass(self):
38+
@staticmethod
39+
def _get_target_class():
3940
from google.cloud.bigquery.table import Table
4041
return Table
4142

bigtable/unit_tests/test_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,8 @@ class TestClient(unittest.TestCase):
267267
DISPLAY_NAME = 'display-name'
268268
USER_AGENT = 'you-sir-age-int'
269269

270-
def _getTargetClass(self):
270+
@staticmethod
271+
def _get_target_class():
271272
from google.cloud.bigtable.client import Client
272273
return Client
273274

bigtable/unit_tests/test_cluster.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ class TestCluster(unittest.TestCase):
2525
'/instances/' + INSTANCE_ID +
2626
'/clusters/' + CLUSTER_ID)
2727

28-
def _getTargetClass(self):
28+
@staticmethod
29+
def _get_target_class():
2930
from google.cloud.bigtable.cluster import Cluster
3031
return Cluster
3132

0 commit comments

Comments
 (0)