Skip to content

Commit 3923b5d

Browse files
committed
0.0.181
1 parent dd1ab4d commit 3923b5d

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

orso/schema.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ def to_flatcolumn(self) -> "FlatColumn":
276276
precision=self.precision,
277277
lowest_value=self.lowest_value,
278278
highest_value=self.highest_value,
279-
null_count=self.null_count
279+
null_count=self.null_count,
280280
)
281281

282282
@property
@@ -290,6 +290,7 @@ def all_names(self):
290290
def arrow_field(self):
291291
import pyarrow
292292

293+
# fmt: off
293294
type_map: dict = {
294295
OrsoTypes.BOOLEAN: pyarrow.bool_(),
295296
OrsoTypes.BLOB: pyarrow.binary(),
@@ -298,16 +299,15 @@ def arrow_field(self):
298299
OrsoTypes.TIME: pyarrow.time32("ms"),
299300
OrsoTypes.INTERVAL: pyarrow.month_day_nano_interval(),
300301
OrsoTypes.STRUCT: pyarrow.binary(), # convert structs to JSON strings/BSONs
301-
OrsoTypes.DECIMAL: pyarrow.decimal128(
302-
self.precision or DECIMAL_PRECISION, self.scale or 10
303-
),
302+
OrsoTypes.DECIMAL: pyarrow.decimal128(self.precision or DECIMAL_PRECISION, self.scale or 10),
304303
OrsoTypes.DOUBLE: pyarrow.float64(),
305304
OrsoTypes.INTEGER: pyarrow.int64(),
306305
OrsoTypes.ARRAY: pyarrow.list_(pyarrow.string()),
307306
OrsoTypes.VARCHAR: pyarrow.string(),
308307
OrsoTypes.JSONB: pyarrow.binary(),
309308
OrsoTypes.NULL: pyarrow.null(),
310309
}
310+
# fmt: on
311311

312312
return pyarrow.field(name=self.name, type=type_map.get(self.type, pyarrow.string()))
313313

@@ -492,7 +492,15 @@ class RelationSchema:
492492
aliases: List[str] = field(default_factory=list)
493493
columns: List[FlatColumn] = field(default_factory=list)
494494
primary_key: Optional[str] = None
495+
495496
row_count_metric: Optional[int] = None
497+
"""Statistic of the number of rows in the relation."""
498+
row_count_estimate: Optional[int] = None
499+
"""Estimate of the number of rows in the relation."""
500+
data_size_metric: Optional[int] = None
501+
"""Statistic of the size of the data in the relation."""
502+
data_size_estimate: Optional[int] = None
503+
"""Estimate of the size of the data in the relation."""
496504

497505
def __iter__(self):
498506
"""Return an iterator over column names."""

orso/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
# See the License for the specific language governing permissions and
1111
# limitations under the License.
1212

13-
__version__: str = "0.0.180"
13+
__version__: str = "0.0.181"
1414
__author__: str = "@joocer"

0 commit comments

Comments
 (0)