Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
liferoad committed Nov 18, 2024
1 parent d809b3b commit baea2a2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sdks/python/apache_beam/coders/coders_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,14 +244,16 @@ def test_to_type_hint(self):
coder = coders.LengthPrefixCoder(coders.BytesCoder())
assert coder.to_type_hint() is bytes


class NumpyIntAsKeyTest(unittest.TestCase):
def test_numpy_int(self):
# this type is not supported as the key
import numpy as np

with self.assertRaises(TypeError):
with TestPipeline() as p:
indata = p | "Create" >> beam.Create([(a, int(a)) for a in np.arange(3)])
indata = p | "Create" >> beam.Create([(a, int(a))
for a in np.arange(3)])

# Apply CombinePerkey to sum values for each key.
indata | "CombinePerKey" >> beam.CombinePerKey(sum)
Expand Down

0 comments on commit baea2a2

Please sign in to comment.