Skip to content

Commit 6830e40

Browse files
committed
fixes merge conflict
1 parent e762133 commit 6830e40

File tree

3 files changed

+0
-114
lines changed

3 files changed

+0
-114
lines changed

google/cloud/bigquery/schema.py

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
from google.cloud.bigquery import standard_sql
2525
from google.cloud.bigquery._helpers import (
2626
_isinstance_or_raise,
27-
_from_api_repr,
2827
_get_sub_prop,
2928
)
3029
from google.cloud.bigquery.enums import StandardSqlTypeNames
@@ -599,61 +598,6 @@ def to_api_repr(self) -> dict:
599598
return answer
600599

601600

602-
# class TableSchema:
603-
# """Schema of a table
604-
605-
# Args:
606-
# fields (Optional[list]): Describes the fields in a table.
607-
# foreignTypeInfo (Optional[str]): Specifies metadata of the foreign data type
608-
# definition in field schema.
609-
# """
610-
611-
# def __init__(
612-
# self, fields: Optional[list] = None, foreign_type_info: Optional[str] = None
613-
# ):
614-
# self._properties = {}
615-
# self.fields = fields
616-
# self.foreign_type_info = foreign_type_info
617-
618-
# @property
619-
# def fields(self) -> Any:
620-
# """Describes the fields in a table."""
621-
622-
# return self._properties.get("fields")
623-
624-
# @fields.setter
625-
# def fields(self, value: list, dtype: str) -> str:
626-
# value = _isinstance_or_raise(value, list, none_allowed=True)
627-
# self._properties["fields"] = value
628-
629-
# @property
630-
# def foreign_type_info(self) -> Any:
631-
# """Optional. Specifies metadata of the foreign data type definition in
632-
# field schema (TableFieldSchema.foreign_type_definition)."""
633-
634-
# return self._properties.get("foreignTypeInfo")
635-
636-
# @foreign_type_info.setter
637-
# def foreign_type_info(self, value: str, dtype: str) -> str:
638-
# if not isinstance(value, str):
639-
# raise ValueError(
640-
# f"Pass {value} as a '{repr(dtype)}'." f"Got {type(value)}."
641-
# )
642-
# self._properties["foreignTypeInfo"] = value
643-
644-
# def to_api_repr(self) -> dict:
645-
# """Build an API representation of this object.
646-
647-
# Returns:
648-
# Dict[str, Any]:
649-
# A dictionary in the format used by the BigQuery API.
650-
# """
651-
# return copy.deepcopy(self._properties)
652-
653-
# def from_api_repr(self, resource):
654-
# return _from_api_repr(self, resource)
655-
656-
657601
class ForeignTypeInfo:
658602
"""Metadata about the foreign data type definition such as the system in which the
659603
type is defined.

tests/unit/test_schema.py

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
ForeignTypeInfo,
2020
StorageDescriptor,
2121
SerDeInfo,
22-
# TODO: delete this line...TableSchema,
2322
)
2423

2524
import unittest
@@ -1331,41 +1330,3 @@ def test_to_api_repr(self):
13311330
assert serde_info.to_api_repr() == expected_repr
13321331

13331332
# TODO: needs a from_api_repr() test.
1334-
1335-
1336-
# @pytest.fixture
1337-
# def _make_foreign_type_info():
1338-
# return ForeignTypeInfo(
1339-
# type_system="TODO_fake_type_system",
1340-
# )
1341-
1342-
1343-
# class TestTableSchema:
1344-
# @staticmethod
1345-
# def _get_target_class():
1346-
# return TableSchema
1347-
1348-
# def _make_one(self, *args, **kwargs):
1349-
# return self._get_target_class()(*args, **kwargs)
1350-
1351-
# def test_ctor_valid_input(self, _make_foreign_type_info):
1352-
# table_schema = self._make_one(
1353-
# fields="TODO needs a fields object",
1354-
# foreign_type_info=_make_foreign_type_info.to_api_repr(),
1355-
# )
1356-
# # Test default constructors
1357-
# # Create expected TableSchema object
1358-
# # * use target_class
1359-
# # * use make_one
1360-
# # Create result TableSchema object
1361-
# # compare the two
1362-
# assert False
1363-
1364-
# def test_ctor_invalid_input(self):
1365-
# assert False
1366-
1367-
# def test_to_api_repr(self):
1368-
# assert False
1369-
1370-
# def test_from_api_repr(self):
1371-
# assert False

tests/unit/test_table.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -570,25 +570,6 @@ def test_ctor_w_schema(self):
570570

571571
self.assertEqual(table.schema, [full_name, age])
572572

573-
def test_ctor_w_schema_klass(self):
574-
from google.cloud.bigquery.schema import SchemaField
575-
from google.cloud.bigquery.schema import Schema
576-
577-
dataset = DatasetReference(self.PROJECT, self.DS_ID)
578-
table_ref = dataset.table(self.TABLE_NAME)
579-
full_name = SchemaField("full_name", "STRING", mode="REQUIRED")
580-
age = SchemaField("age", "INTEGER", mode="REQUIRED")
581-
# ONLY CHANGE IN THE BODY OF THE TEST
582-
schema = Schema(foreign_type_info="EXAMPLE FTF", fields=[full_name, age])
583-
584-
table = self._make_one(table_ref, schema=schema)
585-
print(
586-
f"DINOSAUR: {schema}\n{dir(schema)}\n{type(schema)}\n{type(table.schema)}"
587-
)
588-
self.assertEqual(table.schema, [full_name, age])
589-
# ADDITIONAL CHECK TEST
590-
self.assertEqual(table.schema.foreign_type_info, "EXAMPLE FTF")
591-
592573
def test_ctor_string(self):
593574
table = self._make_one("some-project.some_dset.some_tbl")
594575
self.assertEqual(table.project, "some-project")

0 commit comments

Comments
 (0)