Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
4d9c497
Enable prism by default
damccorm Apr 11, 2025
99837ca
Clean up fallback code
damccorm Apr 11, 2025
e28e463
Clean up fallback code
damccorm Apr 11, 2025
837ba2f
Add missing base case
damccorm Apr 11, 2025
3233b69
Add missing base case
damccorm Apr 11, 2025
4929906
Fix tests
damccorm Apr 14, 2025
ad9b0dc
Fix tests
damccorm Apr 14, 2025
20370cb
exclude unsupported state
damccorm Apr 15, 2025
cbaa083
Merge branch 'master' of https://github.com/apache/beam into users/da…
damccorm Apr 16, 2025
7e13214
Merge branch 'master' of https://github.com/apache/beam into users/da…
damccorm May 12, 2025
a6db1a4
Exclude locally materialized results
damccorm May 12, 2025
1e49f55
Fix fallback/dupe execution
damccorm May 12, 2025
e6ca143
Fix some snippet tests
damccorm May 13, 2025
4e3a675
Disable argparse abbreviation
damccorm May 13, 2025
a9e07a7
Some test fixes for prism switch
damccorm May 14, 2025
94ad26a
Merge in master
damccorm May 14, 2025
bda68b1
lint
damccorm May 15, 2025
d8b3534
row fixes
damccorm May 15, 2025
c21dafa
Make row comp logic default
damccorm May 15, 2025
b8343e6
Add more yaml examples
damccorm May 15, 2025
e08ead5
Fix dataframes tests
damccorm May 16, 2025
095caca
Merge branch 'master' of https://github.com/apache/beam into users/da…
damccorm May 16, 2025
81e5c54
Examples fixes
damccorm May 16, 2025
9250510
type hints
damccorm May 16, 2025
3d613c5
Some more transform test fixes
damccorm May 17, 2025
81e5e8a
more test fixes
damccorm May 19, 2025
99c07a7
Merge branch 'master' of https://github.com/apache/beam into users/da…
damccorm May 29, 2025
d6ff73e
More generic error checks
damccorm May 29, 2025
9b8218a
Reshuffle tests
damccorm May 29, 2025
f62e442
enrichment error catching
damccorm May 30, 2025
22fafe7
more test fixes
damccorm May 30, 2025
5e75f32
Scope out external transforms
damccorm May 30, 2025
baf2468
simplify test
damccorm May 30, 2025
e057572
Fix more tests
damccorm May 30, 2025
e3e757b
Clean up test
damccorm Jun 2, 2025
77f682e
correct runner mode
damccorm Jun 2, 2025
a70a33f
ML tests
damccorm Jun 2, 2025
2678f7d
ib collect test
damccorm Jun 2, 2025
9b7703e
Make sure assertions dont fire in incorrect order
damccorm Jun 2, 2025
60f0918
ML test fixes
damccorm Jun 3, 2025
f04c952
typing
damccorm Jun 3, 2025
621749b
More fixes
damccorm Jun 3, 2025
81ac404
some more fixes
damccorm Jun 3, 2025
2b6c279
Another error fix
damccorm Jun 3, 2025
095b1a3
Temporarily set log level to debug
damccorm Jun 3, 2025
84ade39
yapf
damccorm Jun 3, 2025
998dccf
More error regex fixes
damccorm Jun 3, 2025
e3dfb34
Fix some error messages/metric tests
damccorm Jun 4, 2025
1af63b7
more generic tests
damccorm Jun 4, 2025
ce747b5
Upgrade logging to warning to see what is happening
damccorm Jun 5, 2025
9a7529d
Some more patches
damccorm Jun 6, 2025
8f76ca4
Wait until finish for test pipelines
damccorm Jun 9, 2025
7b43e33
Merge branch 'master' of https://github.com/apache/beam into users/da…
damccorm Jun 9, 2025
a10a882
fix test_always
damccorm Jun 9, 2025
8dccd5b
A few more small fixes
damccorm Jun 9, 2025
c0fc545
Merge in master
damccorm Jun 12, 2025
3f73418
Temporarily update logging
damccorm Jun 16, 2025
aa4b03b
Merge branch 'master' of https://github.com/apache/beam into users/da…
damccorm Jun 20, 2025
f21b94a
clean up merge
damccorm Jun 20, 2025
41c20e0
Some more exclusions
damccorm Jun 23, 2025
9aff0d1
Merge branch 'users/damccorm/prismByDefault' of https://github.com/ap…
damccorm Jun 23, 2025
8daca3b
regex isssues
damccorm Jun 23, 2025
34a4f13
Propogate original failure when using instruction cache
damccorm Jun 23, 2025
90edb60
Batching fix
damccorm Jun 23, 2025
544fe04
Trigger some postcommits
damccorm Jun 23, 2025
7f52afa
fmt
damccorm Jun 23, 2025
1efa877
More test fixes
damccorm Jun 23, 2025
6504c33
Fix a few more tests
damccorm Jun 24, 2025
50495a4
linting
damccorm Jun 24, 2025
2410ca6
Bump workflow timeout (#35420)
damccorm Jun 25, 2025
46bb8a9
linting/fixes
damccorm Jun 26, 2025
2d5cd07
Merge branch 'users/damccorm/prismByDefault' of https://github.com/ap…
damccorm Jun 26, 2025
051a4ed
Merge in master
damccorm Jun 26, 2025
7909c00
linting
damccorm Jun 26, 2025
2ca2f91
Avoid problem with temp file getting deleted
damccorm Jun 27, 2025
96d9f5b
Avoid problem with temp file getting deleted
damccorm Jun 27, 2025
8a8ed63
minor cleanup
damccorm Jun 27, 2025
83472ce
Some more minor fixes
damccorm Jun 27, 2025
6efda27
Merge branch 'master' of https://github.com/apache/beam into users/da…
damccorm Jun 27, 2025
8fde571
Merge in master
damccorm Jun 27, 2025
068d3a0
Fix test
damccorm Jun 27, 2025
a5dde5b
Fix another test with questionable assumptions
damccorm Jun 30, 2025
cb97e70
Dont wait on tmpfile being destroyed
damccorm Jun 30, 2025
3644d18
Merge branch 'master' of https://github.com/apache/beam into users/da…
damccorm Jul 1, 2025
9e2eb68
More regex checks
damccorm Jul 14, 2025
ae1054f
Merge in master
damccorm Jul 14, 2025
83ec444
Add more postcommits, clean up some error messages
damccorm Jul 14, 2025
c1e75b3
Clean up a few tests
damccorm Jul 14, 2025
fa1e54d
simplify test
damccorm Jul 14, 2025
9385804
Clean up test errors
damccorm Jul 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix more tests
  • Loading branch information
damccorm committed May 30, 2025
commit e057572d11b3dd29cc6097144f560c53de9738f7
2 changes: 1 addition & 1 deletion sdks/python/apache_beam/coders/coders_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ def test_numpy_int(self):
# this type is not supported as the key
import numpy as np

with self.assertRaises(TypeError):
with self.assertRaises(Exception):
with TestPipeline() as p:
indata = p | "Create" >> beam.Create([(a, int(a))
for a in np.arange(3)])
Expand Down
15 changes: 12 additions & 3 deletions sdks/python/apache_beam/io/gcp/bigquery_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,9 @@ class DummySchema:
numBytes = 5
schema = DummySchema()

# TODO(https://github.com/apache/beam/issues/34549): This test relies on
# lineage metrics which Prism doesn't seem to handle correctly. Defaulting
# to FnApiRunner instead.
with mock.patch('time.sleep'), \
mock.patch.object(bigquery_v2_client.BigqueryV2.TablesService,
'Get') as mock_get_table, \
Expand All @@ -526,7 +529,7 @@ class DummySchema:
'match'), \
mock.patch.object(FileSystems,
'delete'), \
beam.Pipeline() as p:
beam.Pipeline('FnApiRunner') as p:
call_counter = 0

def store_callback(unused_request):
Expand Down Expand Up @@ -730,11 +733,14 @@ def test_read_export_exception(self, exception_type, error_message):
self.assertIn(error_message, exc.exception.args[0])

def test_read_direct_lineage(self):
# TODO(https://github.com/apache/beam/issues/34549): This test relies on
# lineage metrics which Prism doesn't seem to handle correctly. Defaulting
# to FnApiRunner instead.
with mock.patch.object(bigquery_tools.BigQueryWrapper,
'_bigquery_client'),\
mock.patch.object(bq_storage.BigQueryReadClient,
'create_read_session'),\
beam.Pipeline() as p:
beam.Pipeline('FnApiRunner') as p:

_ = p | ReadFromBigQuery(
method=ReadFromBigQuery.Method.DIRECT_READ,
Expand All @@ -744,8 +750,11 @@ def test_read_direct_lineage(self):
set(["bigquery:project.dataset.table"]))

def test_read_all_lineage(self):
# TODO(https://github.com/apache/beam/issues/34549): This test relies on
# lineage metrics which Prism doesn't seem to handle correctly. Defaulting
# to FnApiRunner instead.
with mock.patch.object(_BigQueryReadSplit, '_export_files') as export, \
beam.Pipeline() as p:
beam.Pipeline('FnApiRunner') as p:

export.return_value = (None, [])

Expand Down
5 changes: 4 additions & 1 deletion sdks/python/apache_beam/io/gcp/bigtableio_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,11 @@ def setUp(self):

def test_write(self):
direct_rows = [self.generate_row(i) for i in range(5)]
# TODO(https://github.com/apache/beam/issues/34549): This test relies on
# lineage metrics which Prism doesn't seem to handle correctly. Defaulting
# to FnApiRunner instead.
with patch.object(MutationsBatcher, 'mutate'), \
patch.object(MutationsBatcher, 'close'), TestPipeline() as p:
patch.object(MutationsBatcher, 'close'), TestPipeline('FnApiRunner') as p:
_ = p | beam.Create(direct_rows) | bigtableio.WriteToBigTable(
self._PROJECT_ID, self._INSTANCE_ID, self._TABLE_ID)
self.assertSetEqual(
Expand Down
12 changes: 12 additions & 0 deletions sdks/python/apache_beam/io/gcp/pubsub_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -831,6 +831,10 @@ def test_read_from_pubsub_no_overwrite(self, unused_mock):
]
options = PipelineOptions([])
options.view_as(StandardOptions).streaming = True
# TODO(https://github.com/apache/beam/issues/34549): This test relies on
# lineage metrics which Prism doesn't seem to handle correctly. Defaulting
# to FnApiRunner instead.
options.view_as(StandardOptions).runner = 'FnApiRunner'
for test_case in ('topic', 'subscription'):
with TestPipeline(options=options) as p:
# Direct runner currently overwrites the whole ReadFromPubSub transform.
Expand Down Expand Up @@ -1006,6 +1010,10 @@ def test_write_to_pubsub_no_overwrite(self, unused_mock):

options = PipelineOptions([])
options.view_as(StandardOptions).streaming = True
# TODO(https://github.com/apache/beam/issues/34549): This test relies on
# lineage metrics which Prism doesn't seem to handle correctly. Defaulting
# to FnApiRunner instead.
options.view_as(StandardOptions).runner = 'FnApiRunner'
with TestPipeline(options=options) as p:
pcoll = p | Create(payloads)
WriteToPubSub(
Expand All @@ -1022,6 +1030,10 @@ def test_write_to_pubsub_with_attributes_no_overwrite(self, unused_mock):

options = PipelineOptions([])
options.view_as(StandardOptions).streaming = True
# TODO(https://github.com/apache/beam/issues/34549): This test relies on
# lineage metrics which Prism doesn't seem to handle correctly. Defaulting
# to FnApiRunner instead.
options.view_as(StandardOptions).runner = 'FnApiRunner'
with TestPipeline(options=options) as p:
pcoll = p | Create(payloads)
# Avoid direct runner overwrites WriteToPubSub
Expand Down
10 changes: 4 additions & 6 deletions sdks/python/apache_beam/io/requestresponse_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
from apache_beam.io.requestresponse import Caller
from apache_beam.io.requestresponse import DefaultThrottler
from apache_beam.io.requestresponse import RequestResponseIO
from apache_beam.io.requestresponse import UserCodeExecutionException
from apache_beam.io.requestresponse import UserCodeTimeoutException
from apache_beam.io.requestresponse import retry_on_exception
except ImportError:
raise unittest.SkipTest('RequestResponseIO dependencies are not installed.')
Expand Down Expand Up @@ -98,7 +96,7 @@ def test_valid_call(self):

def test_call_timeout(self):
caller = CallerWithTimeout()
with self.assertRaises(UserCodeTimeoutException):
with self.assertRaises(Exception):
with TestPipeline() as test_pipeline:
_ = (
test_pipeline
Expand All @@ -107,7 +105,7 @@ def test_call_timeout(self):

def test_call_runtime_error(self):
caller = CallerWithRuntimeError()
with self.assertRaises(UserCodeExecutionException):
with self.assertRaises(Exception):
with TestPipeline() as test_pipeline:
_ = (
test_pipeline
Expand All @@ -120,7 +118,7 @@ def test_retry_on_exception(self):

def test_caller_backoff_retry_strategy(self):
caller = CallerThatRetries()
with self.assertRaises(TooManyRequests) as cm:
with self.assertRaises(Exception) as cm:
with TestPipeline() as test_pipeline:
_ = (
test_pipeline
Expand All @@ -130,7 +128,7 @@ def test_caller_backoff_retry_strategy(self):

def test_caller_no_retry_strategy(self):
caller = CallerThatRetries()
with self.assertRaises(TooManyRequests) as cm:
with self.assertRaises(Exception) as cm:
with TestPipeline() as test_pipeline:
_ = (
test_pipeline
Expand Down
14 changes: 12 additions & 2 deletions sdks/python/apache_beam/ml/anomaly/transforms_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,19 @@ def _prediction_iterable_is_equal_to(

if len(a_list) != len(b_list):
return False

a_dict = {}
b_dict = {}
for i in a_list:
a_dict[i.model_id] = i
for i in b_list:
b_dict[i.model_id] = i

for k, a_val in a_dict.items():
if k not in b_dict or not _prediction_is_equal_to(a_val, b_dict[k]):
return False

return all(
map(lambda x: _prediction_is_equal_to(x[0], x[1]), zip(a_list, b_list)))
return True


def _prediction_is_equal_to(a: AnomalyPrediction, b: AnomalyPrediction):
Expand Down
5 changes: 3 additions & 2 deletions sdks/python/apache_beam/runners/runner_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
from apache_beam.metrics.metric import Metrics
from apache_beam.runners import DirectRunner
from apache_beam.runners import create_runner
from apache_beam.runners.portability.fn_api_runner import FnApiRunner


class RunnerTest(unittest.TestCase):
Expand All @@ -55,7 +56,7 @@ def test_create_runner_shorthand(self):

def test_run_api(self):
my_metric = Metrics.counter('namespace', 'my_metric')
runner = DirectRunner()
runner = FnApiRunner()
result = runner.run(
beam.Create([1, 10, 100]) | beam.Map(lambda x: my_metric.inc(x)))
result.wait_until_finish()
Expand All @@ -72,7 +73,7 @@ def fn(start):
| beam.Create([1, 10, 100])
| beam.Map(lambda x: my_metric.inc(x)))

runner = DirectRunner()
runner = FnApiRunner()
result = runner.run(fn)
result.wait_until_finish()
# Use counters to assert the pipeline actually ran.
Expand Down
Loading