Skip to content

Commit e3e7b17

Browse files
committed
chore: make labels tests more robust to test order
1 parent 12e04d5 commit e3e7b17

File tree

5 files changed

+21
-6
lines changed

5 files changed

+21
-6
lines changed

.github/workflows/docs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ on:
22
pull_request:
33
branches:
44
- main
5+
push:
6+
branches:
7+
- main
58
name: docs
69
jobs:
710
docs:

.github/workflows/lint.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ on:
22
pull_request:
33
branches:
44
- main
5+
push:
6+
branches:
7+
- main
58
name: lint
69
jobs:
710
lint:

.github/workflows/mypy.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ on:
22
pull_request:
33
branches:
44
- main
5+
push:
6+
branches:
7+
- main
58
name: mypy
69
jobs:
710
mypy:

.github/workflows/unittest.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ on:
22
pull_request:
33
branches:
44
- main
5+
push:
6+
branches:
7+
- main
58
name: unittest
69
jobs:
710
unit:

tests/unit/session/test_io_bigquery.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,10 @@ def test_create_job_configs_labels_length_limit_met_and_labels_is_none():
131131
df.head()
132132
api_methods = log_adapter._api_methods
133133

134-
labels = io_bq.create_job_configs_labels(
135-
job_configs_labels=None, api_methods=api_methods
136-
)
134+
with bpd.option_context("compute.extra_query_labels", {}):
135+
labels = io_bq.create_job_configs_labels(
136+
job_configs_labels=None, api_methods=api_methods
137+
)
137138
assert labels is not None
138139
assert len(labels) == log_adapter.MAX_LABELS_COUNT
139140
assert "dataframe-head" in labels.values()
@@ -158,9 +159,11 @@ def test_create_job_configs_labels_length_limit_met():
158159
df.max()
159160
api_methods = log_adapter._api_methods
160161

161-
labels = io_bq.create_job_configs_labels(
162-
job_configs_labels=cur_labels, api_methods=api_methods
163-
)
162+
with bpd.option_context("compute.extra_query_labels", {}):
163+
labels = io_bq.create_job_configs_labels(
164+
job_configs_labels=cur_labels, api_methods=api_methods
165+
)
166+
164167
assert labels is not None
165168
assert len(labels) == 56
166169
assert "dataframe-max" in labels.values()

0 commit comments

Comments
 (0)