github.com/apache/beam/sdks/v2@v2.48.2/python/apache_beam/runners/interactive/options/interactive_options.py (about)

     1  #
     2  # Licensed to the Apache Software Foundation (ASF) under one or more
     3  # contributor license agreements.  See the NOTICE file distributed with
     4  # this work for additional information regarding copyright ownership.
     5  # The ASF licenses this file to You under the Apache License, Version 2.0
     6  # (the "License"); you may not use this file except in compliance with
     7  # the License.  You may obtain a copy of the License at
     8  #
     9  #    http://www.apache.org/licenses/LICENSE-2.0
    10  #
    11  # Unless required by applicable law or agreed to in writing, software
    12  # distributed under the License is distributed on an "AS IS" BASIS,
    13  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    14  # See the License for the specific language governing permissions and
    15  # limitations under the License.
    16  #
    17  
    18  """Module to expose options that control how Interactive Beam works.
    19  
    20  For internal use only; no backwards-compatibility guarantees.
    21  """
    22  
    23  # pytype: skip-file
    24  
    25  from dateutil import tz
    26  
    27  from apache_beam.runners.interactive.options import capture_control
    28  
    29  
    30  class InteractiveOptions(object):
    31    """An intermediate facade to query and configure options that guide how
    32    Interactive Beam works."""
    33    def __init__(self):
    34      self._capture_control = capture_control.CaptureControl()
    35      self._display_timestamp_format = '%Y-%m-%d %H:%M:%S.%f%z'
    36      self._display_timezone = tz.tzlocal()
    37      self._cache_root = None
    38  
    39    def __repr__(self):
    40      options_str = '\n'.join(
    41          '{} = {}'.format(k, getattr(self, k)) for k in dir(self)
    42          if k[0] != '_' and k != 'capture_control')
    43      return 'interactive_beam.options:\n{}'.format(options_str)
    44  
    45    @property
    46    def capture_control(self):
    47      return self._capture_control