Skip to content

Commit a0ddc25

Browse files
author
ShreyeshArangath
committed
fix Ci issues
1 parent a8623c2 commit a0ddc25

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

crates/core/src/metrics.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,7 @@ impl PyMetric {
8989
match ts.value() {
9090
Some(dt) => {
9191
let nanos = dt.timestamp_nanos_opt().ok_or_else(|| {
92-
PyErr::new::<pyo3::exceptions::PyOverflowError, _>(
93-
"timestamp out of range",
94-
)
92+
PyErr::new::<pyo3::exceptions::PyOverflowError, _>("timestamp out of range")
9593
})?;
9694
let datetime_mod = py.import("datetime")?;
9795
let datetime_cls = datetime_mod.getattr("datetime")?;
@@ -126,8 +124,12 @@ impl PyMetric {
126124
MetricValue::SpilledBytes(c) => Ok(Some(c.value().into_pyobject(py)?.into_any())),
127125
MetricValue::SpilledRows(c) => Ok(Some(c.value().into_pyobject(py)?.into_any())),
128126
MetricValue::CurrentMemoryUsage(g) => Ok(Some(g.value().into_pyobject(py)?.into_any())),
129-
MetricValue::Count { count, .. } => Ok(Some(count.value().into_pyobject(py)?.into_any())),
130-
MetricValue::Gauge { gauge, .. } => Ok(Some(gauge.value().into_pyobject(py)?.into_any())),
127+
MetricValue::Count { count, .. } => {
128+
Ok(Some(count.value().into_pyobject(py)?.into_any()))
129+
}
130+
MetricValue::Gauge { gauge, .. } => {
131+
Ok(Some(gauge.value().into_pyobject(py)?.into_any()))
132+
}
131133
MetricValue::Time { time, .. } => Ok(Some(time.value().into_pyobject(py)?.into_any())),
132134
MetricValue::StartTimestamp(ts) | MetricValue::EndTimestamp(ts) => {
133135
Self::timestamp_to_pyobject(py, ts)

python/datafusion/plan.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@
1919

2020
from __future__ import annotations
2121

22-
import datetime
23-
2422
from typing import TYPE_CHECKING, Any
2523

2624
import datafusion._internal as df_internal
2725

2826
if TYPE_CHECKING:
27+
import datetime
28+
2929
from datafusion.context import SessionContext
3030

3131
__all__ = [

python/tests/test_plans.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import datetime
1919

2020
import pytest
21-
2221
from datafusion import (
2322
ExecutionPlan,
2423
LogicalPlan,
@@ -67,7 +66,8 @@ def test_metrics_tree_walk() -> None:
6766
if ms.output_rows is not None:
6867
output_rows_by_op[name] = ms.output_rows
6968

70-
# The filter passes rows where column1 > 1, so exactly 2 rows from (1,'a'),(2,'b'),(3,'c').
69+
# The filter passes rows where column1 > 1, so exactly
70+
# 2 rows from (1,'a'),(2,'b'),(3,'c').
7171
# At least one operator must report exactly 2 output rows (the filter).
7272
assert 2 in output_rows_by_op.values(), (
7373
f"Expected an operator with output_rows=2, got {output_rows_by_op}"

0 commit comments

Comments
 (0)