Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BEAM-1251] Use Python 3 semantics in Cython-compiled modules. #14198

Merged
merged 1 commit into from
Mar 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions sdks/python/apache_beam/coders/stream.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# limitations under the License.
#

# cython: language_level=3

"""Compiled version of the Stream objects used by CoderImpl.
For internal use only; no backwards-compatibility guarantees.
Expand Down
2 changes: 2 additions & 0 deletions sdks/python/apache_beam/metrics/cells.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# limitations under the License.
#

# cython: language_level=3

"""
This file contains metric cell classes. A metric cell is used to accumulate
in-memory changes to a metric. It represents a specific metric in a single
Expand Down
2 changes: 2 additions & 0 deletions sdks/python/apache_beam/metrics/execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# limitations under the License.
#

# cython: language_level=3

"""
This module is for internal use only; no backwards-compatibility guarantees.

Expand Down
1 change: 1 addition & 0 deletions sdks/python/apache_beam/runners/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# limitations under the License.
#
# cython: profile=True
# cython: language_level=3

"""Worker operations executor.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#

# cython: profile=True
# cython: language_level=3

"""State sampler for tracking time spent in execution steps.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#

# cython: profile=True
# cython: language_level=3

""" For internal use only. No backwards compatibility guarantees."""

Expand Down
2 changes: 2 additions & 0 deletions sdks/python/apache_beam/transforms/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# limitations under the License.
#

# cython: language_level=3

"""This module has all statistic related transforms.

This ApproximateUnique class will be deprecated [1]. PLease look into using
Expand Down
1 change: 1 addition & 0 deletions sdks/python/apache_beam/utils/counters.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

# cython: profile=False
# cython: overflowcheck=True
# cython: language_level=3

"""Counters collect the progress of the Worker for reporting to the service.
Expand Down
3 changes: 2 additions & 1 deletion sdks/python/apache_beam/utils/windowed_value.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
# editing this file as WindowedValues are created for every element for
# every step in a Beam pipeline.

#cython: profile=True
# cython: profile=True
# cython: language_level=3

# pytype: skip-file

Expand Down
1 change: 1 addition & 0 deletions sdks/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ def run(self):
'*/*.pyx', '*/*/*.pyx', '*/*.pxd', '*/*/*.pxd', '*/*.h', '*/*/*.h',
'testing/data/*.yaml', 'portability/api/*.yaml']},
ext_modules=cythonize([
# Make sure to use language_level=3 cython directive in files below.
'apache_beam/**/*.pyx',
'apache_beam/coders/coder_impl.py',
'apache_beam/metrics/cells.py',
Expand Down