| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 23a173b commit 4302c76
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2128,7 +2128,14 @@ def to_api_repr(self): | |||
| 2128 | 2128 | return self._properties | |
| 2129 | 2129 | ||
| 2130 | 2130 | def _key(self): | |
| 2131 | - return tuple(sorted(self._properties.items())) | ||
| 2131 | + properties = self._properties.copy() | ||
| 2132 | + if "type" in properties.keys(): | ||
| 2133 | + properties["type_"] = properties.pop("type") | ||
| 2134 | + if "requirePartitionFilter" in properties.keys(): | ||
| 2135 | + properties["require_partition_filter"] = properties.pop("requirePartitionFilter") | ||
| 2136 | + if "expirationMs" in properties.keys(): | ||
| 2137 | + properties["expiration_ms"] = properties.pop("expirationMs", None) | ||
| 2138 | + return tuple(sorted(properties.items())) | ||
| 2132 | 2139 | ||
| 2133 | 2140 | def __eq__(self, other): | |
| 2134 | 2141 | if not isinstance(other, TimePartitioning): | |
@@ -2142,7 +2149,7 @@ def __hash__(self): | |||
| 2142 | 2149 | return hash(self._key()) | |
| 2143 | 2150 | ||
| 2144 | 2151 | def __repr__(self): | |
| 2145 | - key_vals = ["{}={}".format(key, val) for key, val in self._key()] | ||
| 2152 | + key_vals = ["{}={}".format(key, repr(val)) for key, val in self._key()] | ||
| 2146 | 2153 | return "TimePartitioning({})".format(",".join(key_vals)) | |
| 2147 | 2154 | ||
| 2148 | 2155 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3743,7 +3743,7 @@ def test___hash__not_equals(self): | |||
| 3743 | 3743 | ||
| 3744 | 3744 | def test___repr___minimal(self): | |
| 3745 | 3745 | time_partitioning = self._make_one() | |
| 3746 | - expected = "TimePartitioning(type=DAY)" | ||
| 3746 | + expected = "TimePartitioning(type_='DAY')" | ||
| 3747 | 3747 | self.assertEqual(repr(time_partitioning), expected) | |
| 3748 | 3748 | ||
| 3749 | 3749 | def test___repr___explicit(self): | |
@@ -3752,7 +3752,7 @@ def test___repr___explicit(self): | |||
| 3752 | 3752 | time_partitioning = self._make_one( | |
| 3753 | 3753 | type_=TimePartitioningType.DAY, field="name", expiration_ms=10000 | |
| 3754 | 3754 | ) | |
| 3755 | - expected = "TimePartitioning(" "expirationMs=10000," "field=name," "type=DAY)" | ||
| 3755 | + expected = "TimePartitioning(" "expiration_ms=10000," "field=name," "type_='DAY')" | ||
| 3756 | 3756 | self.assertEqual(repr(time_partitioning), expected) | |
| 3757 | 3757 | ||
| 3758 | 3758 | def test_set_expiration_w_none(self): | |
| Back | FazBrowse Home | New Git URL |
0 commit comments