HEX
Server: Apache/2.4.65 (Ubuntu)
System: Linux ielts-store-v2 6.8.0-1036-gcp #38~22.04.1-Ubuntu SMP Thu Aug 14 01:19:18 UTC 2025 x86_64
User: root (0)
PHP: 7.2.34-54+ubuntu20.04.1+deb.sury.org+1
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Upload Files
File: //snap/google-cloud-cli/396/platform/bq/frontend/flags.py
#!/usr/bin/env python
"""Flags shared across multiple commands."""

from typing import List, Optional

from absl import flags


def define_null_marker(
    flag_values: flags.FlagValues,
) -> flags.FlagHolder[Optional[str]]:
  return flags.DEFINE_string(
      'null_marker',
      None,
      'An optional custom string that will represent a NULL value'
      'in CSV External table data.',
      flag_values=flag_values,
  )


def define_null_markers(
    flag_values: flags.FlagValues,
) -> flags.FlagHolder[Optional[List[str]]]:
  return flags.DEFINE_list(
      'null_markers',
      [],
      'An optional list of custom strings that will represent a NULL value'
      'in CSV External table data.',
      flag_values=flag_values,
  )


def define_time_zone(
    flag_values: flags.FlagValues,
) -> flags.FlagHolder[Optional[str]]:
  return flags.DEFINE_string(
      'time_zone',
      None,
      'Default time zone that will apply when parsing timestamp values that'
      ' have no specific time zone. For example, "America/Los_Angeles".',
      flag_values=flag_values,
  )


def define_date_format(
    flag_values: flags.FlagValues,
) -> flags.FlagHolder[Optional[str]]:
  return flags.DEFINE_string(
      'date_format',
      None,
      'Format elements that define how the DATE values are formatted in the'
      ' input files. For example, "MM/DD/YYYY".',
      flag_values=flag_values,
  )


def define_datetime_format(
    flag_values: flags.FlagValues,
) -> flags.FlagHolder[Optional[str]]:
  return flags.DEFINE_string(
      'datetime_format',
      None,
      'Format elements that define how the DATETIME values are formatted in'
      ' the input files. For example, "MM/DD/YYYY HH24:MI:SS.FF3".',
      flag_values=flag_values,
  )


def define_time_format(
    flag_values: flags.FlagValues,
) -> flags.FlagHolder[Optional[str]]:
  return flags.DEFINE_string(
      'time_format',
      None,
      'Format elements that define how the TIME values are formatted in the'
      ' input files. For example, "HH24:MI:SS.FF3".',
      flag_values=flag_values,
  )


def define_timestamp_format(
    flag_values: flags.FlagValues,
) -> flags.FlagHolder[Optional[str]]:
  return flags.DEFINE_string(
      'timestamp_format',
      None,
      'Format elements that define how the TIMESTAMP values are formatted in'
      ' the input files. For example, "MM/DD/YYYY HH24:MI:SS.FF3".',
      flag_values=flag_values,
  )


def define_source_column_match(
    flag_values: flags.FlagValues,
) -> flags.FlagHolder[Optional[str]]:
  return flags.DEFINE_enum(
      'source_column_match',
      None,
      ['POSITION', 'NAME'],
      'Controls the strategy used to match loaded columns to the schema in CSV'
      ' External table data. Options include:'
      '\n POSITION: matches by position. This option assumes that the columns'
      ' are ordered the same way as the schema.'
      '\n NAME: matches by name. This option reads the header row as column'
      ' names and reorders columns to match the field names in the schema.',
      flag_values=flag_values,
  )


def define_parquet_map_target_type(
    flag_values: flags.FlagValues,
) -> flags.FlagHolder[Optional[str]]:
  return flags.DEFINE_enum(
      'parquet_map_target_type',
      None,
      ['ARRAY_OF_STRUCT'],
      'Specifies the parquet map type. If it is equal to ARRAY_OF_STRUCT,'
      ' then a map_field will be represented with a repeated struct (that has'
      ' key and value fields).',
      flag_values=flag_values,
  )


def define_timestamp_target_precision(
    flag_values: flags.FlagValues,
) -> flags.FlagHolder[Optional[List[str]]]:
  return flags.DEFINE_list(
      'timestamp_target_precision',
      [],
      'Precisions (maximum number of total digits in base 10) for second of'
      ' TIMESTAMP types that are allowed to the destination table for'
      ' autodetection mode.'
      '\n'
      '\n Available for the formats: CSV.'
      '\n'
      '\n For the CSV Format, Possible values include:'
      '\n Not Specified, [], or [6]: timestamp(6) for all auto detected'
      ' TIMESTAMP columns.'
      '\n [6, 12]: timestamp(6) for all auto detected TIMESTAMP columns that'
      ' have less than 6 digits of subseconds. timestamp(12) for all auto'
      ' detected TIMESTAMP columns that have more than 6 digits of subseconds.'
      '\n [12]: timestamp(12) for all auto detected TIMESTAMP columns.'
      '\n'
      '\n The order of the elements in this array is ignored.'
      '\n Inputs that have higher precision than the highest target precision'
      ' will be truncated.',
      flag_values=flag_values,
  )


def define_reservation_id_for_a_job(
    flag_values: flags.FlagValues,
) -> flags.FlagHolder[Optional[str]]:
  return flags.DEFINE_string(
      'reservation_id',
      None,
      'Reservation ID used when executing the job. Reservation should be in the'
      'format of project_id:reservation_id, project_id:location.reservation_id,'
      'or reservation_id',
      flag_values=flag_values,
  )


def define_event_driven_schedule(
    flag_values: flags.FlagValues,
) -> flags.FlagHolder[Optional[str]]:
  return flags.DEFINE_string(
      'event_driven_schedule',
      None,
      'Event driven schedule in json format. Example:'
      ' --event_driven_schedule=\'{"pubsub_subscription":'
      ' "projects/project-id/subscriptions/subscription-id"}\'. This flag'
      ' should not be used with --schedule, --no_auto_scheduling,'
      ' --schedule_start_time or --schedule_end_time.',
      flag_values=flag_values,
  )


def define_use_full_timestamp(
    flag_values: flags.FlagValues,
) -> flags.FlagHolder[bool]:
  return flags.DEFINE_boolean(
      'use_full_timestamp',
      False,
      'Use full precision ISO8601 string representation for timestamp values'
      ' in the result.',
      flag_values=flag_values,
  )