GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: support slot_ms in QueryPlanEntry (#1831) · chenhance/python-bigquery@d62cabb

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • google/cloud/bigquery/job
    • query.py
  • tests/unit/job
    • test_query_stats.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎google/cloud/bigquery/job/query.py‎

Copy file name to clipboardExpand all lines: google/cloud/bigquery/job/query.py
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2263,6 +2263,11 @@ def steps(self):
22632263
for step in self._properties.get("steps", [])
22642264
]
22652265

2266+
@property
2267+
def slot_ms(self):
2268+
"""Optional[int]: Slot-milliseconds used by the stage."""
2269+
return _helpers._int_or_none(self._properties.get("slotMs"))
2270+
22662271

22672272
class TimelineEntry(object):
22682273
"""TimelineEntry represents progress of a query job at a particular
Collapse file

‎tests/unit/job/test_query_stats.py‎

Copy file name to clipboardExpand all lines: tests/unit/job/test_query_stats.py
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ class TestQueryPlanEntry(_Base):
261261
STATUS = "STATUS"
262262
SHUFFLE_OUTPUT_BYTES = 1024
263263
SHUFFLE_OUTPUT_BYTES_SPILLED = 1
264+
SLOT_MS = 25
264265

265266
START_RFC3339_MICROS = "2018-04-01T00:00:00.000000Z"
266267
END_RFC3339_MICROS = "2018-04-01T00:00:04.000000Z"
@@ -305,6 +306,7 @@ def test_from_api_repr_empty(self):
305306
self.assertIsNone(entry.shuffle_output_bytes)
306307
self.assertIsNone(entry.shuffle_output_bytes_spilled)
307308
self.assertEqual(entry.steps, [])
309+
self.assertIsNone(entry.slot_ms)
308310

309311
def test_from_api_repr_normal(self):
310312
from google.cloud.bigquery.job import QueryPlanEntryStep
@@ -348,6 +350,7 @@ def test_from_api_repr_normal(self):
348350
"substeps": TestQueryPlanEntryStep.SUBSTEPS,
349351
}
350352
],
353+
"slotMs": self.SLOT_MS,
351354
}
352355
klass = self._get_target_class()
353356

@@ -366,6 +369,7 @@ def test_from_api_repr_normal(self):
366369
self.assertEqual(entry.records_written, self.RECORDS_WRITTEN)
367370
self.assertEqual(entry.status, self.STATUS)
368371
self.assertEqual(entry.steps, steps)
372+
self.assertEqual(entry.slot_ms, self.SLOT_MS)
369373

370374
def test_start(self):
371375
from google.cloud._helpers import _RFC3339_MICROS

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.