From 179ef6bda30a7c2b76d31462473ba0393425e2c8 Mon Sep 17 00:00:00 2001 From: Kshitij Aranke Date: Mon, 9 Sep 2024 14:49:18 +0100 Subject: [PATCH 01/19] First pass: expected model context --- tests/unit/context/test_context.py | 1602 +++++++++++++++++++++++++++- 1 file changed, 1600 insertions(+), 2 deletions(-) diff --git a/tests/unit/context/test_context.py b/tests/unit/context/test_context.py index 10e591093ee..cc4e41d1062 100644 --- a/tests/unit/context/test_context.py +++ b/tests/unit/context/test_context.py @@ -1,14 +1,18 @@ import os -from typing import Any, Dict, Set +import re +from argparse import Namespace +from typing import Any, Dict, Mapping, Set from unittest import mock import pytest +import pytz import dbt_common.exceptions from dbt.adapters import factory, postgres from dbt.clients.jinja import MacroStack from dbt.config.project import VarProvider from dbt.context import base, docs, macros, providers, query_header +from dbt.context.base import Var from dbt.contracts.files import FileHash from dbt.contracts.graph.nodes import ( DependsOn, @@ -20,6 +24,7 @@ ) from dbt.node_types import NodeType from dbt_common.events.functions import reset_metadata_vars +from dbt_common.helper_types import WarnErrorOptions from tests.unit.mock_adapter import adapter_factory from tests.unit.utils import clear_plugin, config_from_parts_or_dicts, inject_adapter @@ -276,6 +281,1556 @@ def assert_has_keys(required_keys: Set[str], maybe_keys: Set[str], ctx: Dict[str "config-version": 2, } +PYTZ_COUNTRY_TIMEZONES_LIST = country_timezones_list = [ + ( + ["modules", "pytz", "country_timezones", country_code], + str(pytz.country_timezones[country_code]), + ) + for country_code in pytz.country_timezones +] + +EXPECTED_MODEL_CONTEXT = { + ("var",): {}, + ( + "env_var", + ): ">", + ("return",): "", + ("fromjson",): "", + ("tojson",): "", + ("fromyaml",): "", + ("toyaml",): "", + ("set",): "", + ("set_strict",): "", + ("zip",): "", + ("zip_strict",): "", + ("log",): "", + ("run_started_at",): "None", + ("thread_id",): "MainThread", + ("flags",): { + "CACHE_SELECTED_ONLY": False, + "LOG_CACHE_EVENTS": False, + "FAIL_FAST": False, + "SEND_ANONYMOUS_USAGE_STATS": True, + "LOG_PATH": "logs", + "DEBUG": False, + "WARN_ERROR": None, + "INTROSPECT": True, + "WARN_ERROR_OPTIONS": WarnErrorOptions(include=[], exclude=[]), + "QUIET": False, + "PARTIAL_PARSE": True, + "WRITE_JSON": True, + "STATIC_PARSER": True, + "USE_EXPERIMENTAL_PARSER": False, + "INVOCATION_COMMAND": "dbt unit/context/test_context.py::test_model_runtime_context", + "PRINTER_WIDTH": 80, + "VERSION_CHECK": True, + "LOG_FORMAT": "default", + "NO_PRINT": None, + "PROFILES_DIR": None, + "TARGET_PATH": None, + "EMPTY": None, + "INDIRECT_SELECTION": "eager", + "USE_COLORS": True, + "FULL_REFRESH": False, + "STORE_FAILURES": False, + "WHICH": "run", + }, + ("print",): "", + ("diff_of_two_dicts",): "", + ("local_md5",): "", + ("project_name",): "root", + ("context_macro_stack",): "", + ( + "load_result", + ): ">", + ( + "store_result", + ): ">", + ( + "store_raw_result", + ): ">", + ( + "write", + ): ">", + ( + "render", + ): ">", + ( + "try_or_compiler_error", + ): ">", + ( + "load_agate_table", + ): ">", + ("ref",): "", + ("source",): "", + ("metric",): "", + ("config",): "", + ("execute",): "True", + ("database",): "dbt", + ("schema",): "analytics", + ("adapter",): "", + ("column",): "", + ("graph",): "", + ("model",): "", + ("pre_hooks",): "[]", + ("post_hooks",): "[]", + ("sql",): "", + ("sql_now",): "", + ( + "adapter_macro", + ): ">", + ("selected_resources",): "[]", + ( + "submit_python_job", + ): ">", + ("compiled_code",): "", + ("this",): "", + ("defer_relation",): "", + ("macro_a",): "", + ("macro_b",): "", + ("builtins", "var"): {}, + ( + "builtins", + "env_var", + ): ">", + ("builtins", "return"): "", + ("builtins", "fromjson"): "", + ("builtins", "tojson"): "", + ("builtins", "fromyaml"): "", + ("builtins", "toyaml"): "", + ("builtins", "set"): "", + ("builtins", "set_strict"): "", + ("builtins", "zip"): "", + ("builtins", "zip_strict"): "", + ("builtins", "log"): "", + ("builtins", "run_started_at"): "None", + ("builtins", "thread_id"): "MainThread", + ("builtins", "flags"): { + "CACHE_SELECTED_ONLY": False, + "LOG_CACHE_EVENTS": False, + "FAIL_FAST": False, + "SEND_ANONYMOUS_USAGE_STATS": True, + "LOG_PATH": "logs", + "DEBUG": False, + "WARN_ERROR": None, + "INTROSPECT": True, + "WARN_ERROR_OPTIONS": WarnErrorOptions(include=[], exclude=[]), + "QUIET": False, + "PARTIAL_PARSE": True, + "WRITE_JSON": True, + "STATIC_PARSER": True, + "USE_EXPERIMENTAL_PARSER": False, + "INVOCATION_COMMAND": "dbt unit/context/test_context.py::test_model_runtime_context", + "PRINTER_WIDTH": 80, + "VERSION_CHECK": True, + "LOG_FORMAT": "default", + "NO_PRINT": None, + "PROFILES_DIR": None, + "TARGET_PATH": None, + "EMPTY": None, + "INDIRECT_SELECTION": "eager", + "USE_COLORS": True, + "FULL_REFRESH": False, + "STORE_FAILURES": False, + "WHICH": "run", + }, + ("builtins", "print"): "", + ("builtins", "diff_of_two_dicts"): "", + ("builtins", "local_md5"): "", + ("builtins", "project_name"): "root", + ("builtins", "context_macro_stack"): "", + ( + "builtins", + "load_result", + ): ">", + ( + "builtins", + "store_result", + ): ">", + ( + "builtins", + "store_raw_result", + ): ">", + ( + "builtins", + "write", + ): ">", + ( + "builtins", + "render", + ): ">", + ( + "builtins", + "try_or_compiler_error", + ): ">", + ( + "builtins", + "load_agate_table", + ): ">", + ("builtins", "ref"): "", + ("builtins", "source"): "", + ("builtins", "metric"): "", + ("builtins", "config"): "", + ("builtins", "execute"): "True", + ("builtins", "database"): "dbt", + ("builtins", "schema"): "analytics", + ("builtins", "adapter"): "", + ("builtins", "column"): "", + ("builtins", "graph"): "", + ("builtins", "model"): "", + ("builtins", "pre_hooks"): "[]", + ("builtins", "post_hooks"): "[]", + ("builtins", "sql"): "", + ("builtins", "sql_now"): "", + ( + "builtins", + "adapter_macro", + ): ">", + ("builtins", "selected_resources"): "[]", + ( + "builtins", + "submit_python_job", + ): ">", + ("builtins", "compiled_code"): "", + ("builtins", "this"): "", + ("builtins", "defer_relation"): "", + ("target", "host"): "localhost", + ("target", "port"): "1", + ("target", "user"): "test", + ("target", "database"): "test", + ("target", "schema"): "analytics", + ("target", "connect_timeout"): "10", + ("target", "role"): "None", + ("target", "search_path"): "None", + ("target", "keepalives_idle"): "0", + ("target", "sslmode"): "None", + ("target", "sslcert"): "None", + ("target", "sslkey"): "None", + ("target", "sslrootcert"): "None", + ("target", "application_name"): "dbt", + ("target", "retries"): "1", + ("target", "dbname"): "test", + ("target", "type"): "postgres", + ("target", "threads"): "1", + ("target", "name"): "test", + ("target", "target_name"): "test", + ("target", "profile_name"): "test", + ("invocation_args_dict", "profile_dir"): "/dev/null", + ("invocation_args_dict", "cache_selected_only"): "False", + ("invocation_args_dict", "send_anonymous_usage_stats"): "True", + ("invocation_args_dict", "log_path"): "logs", + ("invocation_args_dict", "introspect"): "True", + ("invocation_args_dict", "quiet"): "False", + ("invocation_args_dict", "partial_parse"): "True", + ("invocation_args_dict", "write_json"): "True", + ("invocation_args_dict", "static_parser"): "True", + ( + "invocation_args_dict", + "invocation_command", + ): "dbt unit/context/test_context.py::test_model_runtime_context", + ("invocation_args_dict", "printer_width"): "80", + ("invocation_args_dict", "version_check"): "True", + ("invocation_args_dict", "log_format"): "default", + ("invocation_args_dict", "indirect_selection"): "eager", + ("invocation_args_dict", "use_colors"): "True", + ("validation", "any"): ".validate_any>", + ("exceptions", "warn"): "", + ("exceptions", "missing_config"): "", + ("exceptions", "missing_materialization"): "", + ("exceptions", "missing_relation"): "", + ("exceptions", "raise_ambiguous_alias"): "", + ("exceptions", "raise_ambiguous_catalog_match"): "", + ("exceptions", "raise_cache_inconsistent"): "", + ("exceptions", "raise_dataclass_not_dict"): "", + ("exceptions", "raise_compiler_error"): "", + ("exceptions", "raise_database_error"): "", + ("exceptions", "raise_dep_not_found"): "", + ("exceptions", "raise_dependency_error"): "", + ("exceptions", "raise_duplicate_patch_name"): "", + ("exceptions", "raise_duplicate_resource_name"): "", + ( + "exceptions", + "raise_invalid_property_yml_version", + ): "", + ("exceptions", "raise_not_implemented"): "", + ("exceptions", "relation_wrong_type"): "", + ("exceptions", "raise_contract_error"): "", + ("exceptions", "column_type_missing"): "", + ("exceptions", "raise_fail_fast_error"): "", + ( + "exceptions", + "warn_snapshot_timestamp_data_types", + ): "", + ("api", "Relation"): "", + ("api", "Column"): "", + ("root", "macro_a"): "", + ("root", "macro_b"): "", + ("modules", "pytz", "timezone"): "", + ("modules", "pytz", "utc"): "UTC", + ("modules", "pytz", "AmbiguousTimeError"): "", + ("modules", "pytz", "InvalidTimeError"): "", + ("modules", "pytz", "NonExistentTimeError"): "", + ("modules", "pytz", "UnknownTimeZoneError"): "", + ( + "modules", + "pytz", + "all_timezones", + ): "['Africa/Abidjan', 'Africa/Accra', 'Africa/Addis_Ababa', 'Africa/Algiers', 'Africa/Asmara', 'Africa/Asmera', 'Africa/Bamako', 'Africa/Bangui', 'Africa/Banjul', 'Africa/Bissau', 'Africa/Blantyre', 'Africa/Brazzaville', 'Africa/Bujumbura', 'Africa/Cairo', 'Africa/Casablanca', 'Africa/Ceuta', 'Africa/Conakry', 'Africa/Dakar', 'Africa/Dar_es_Salaam', 'Africa/Djibouti', 'Africa/Douala', 'Africa/El_Aaiun', 'Africa/Freetown', 'Africa/Gaborone', 'Africa/Harare', 'Africa/Johannesburg', 'Africa/Juba', 'Africa/Kampala', 'Africa/Khartoum', 'Africa/Kigali', 'Africa/Kinshasa', 'Africa/Lagos', 'Africa/Libreville', 'Africa/Lome', 'Africa/Luanda', 'Africa/Lubumbashi', 'Africa/Lusaka', 'Africa/Malabo', 'Africa/Maputo', 'Africa/Maseru', 'Africa/Mbabane', 'Africa/Mogadishu', 'Africa/Monrovia', 'Africa/Nairobi', 'Africa/Ndjamena', 'Africa/Niamey', 'Africa/Nouakchott', 'Africa/Ouagadougou', 'Africa/Porto-Novo', 'Africa/Sao_Tome', 'Africa/Timbuktu', 'Africa/Tripoli', 'Africa/Tunis', 'Africa/Windhoek', 'America/Adak', 'America/Anchorage', 'America/Anguilla', 'America/Antigua', 'America/Araguaina', 'America/Argentina/Buenos_Aires', 'America/Argentina/Catamarca', 'America/Argentina/ComodRivadavia', 'America/Argentina/Cordoba', 'America/Argentina/Jujuy', 'America/Argentina/La_Rioja', 'America/Argentina/Mendoza', 'America/Argentina/Rio_Gallegos', 'America/Argentina/Salta', 'America/Argentina/San_Juan', 'America/Argentina/San_Luis', 'America/Argentina/Tucuman', 'America/Argentina/Ushuaia', 'America/Aruba', 'America/Asuncion', 'America/Atikokan', 'America/Atka', 'America/Bahia', 'America/Bahia_Banderas', 'America/Barbados', 'America/Belem', 'America/Belize', 'America/Blanc-Sablon', 'America/Boa_Vista', 'America/Bogota', 'America/Boise', 'America/Buenos_Aires', 'America/Cambridge_Bay', 'America/Campo_Grande', 'America/Cancun', 'America/Caracas', 'America/Catamarca', 'America/Cayenne', 'America/Cayman', 'America/Chicago', 'America/Chihuahua', 'America/Ciudad_Juarez', 'America/Coral_Harbour', 'America/Cordoba', 'America/Costa_Rica', 'America/Creston', 'America/Cuiaba', 'America/Curacao', 'America/Danmarkshavn', 'America/Dawson', 'America/Dawson_Creek', 'America/Denver', 'America/Detroit', 'America/Dominica', 'America/Edmonton', 'America/Eirunepe', 'America/El_Salvador', 'America/Ensenada', 'America/Fort_Nelson', 'America/Fort_Wayne', 'America/Fortaleza', 'America/Glace_Bay', 'America/Godthab', 'America/Goose_Bay', 'America/Grand_Turk', 'America/Grenada', 'America/Guadeloupe', 'America/Guatemala', 'America/Guayaquil', 'America/Guyana', 'America/Halifax', 'America/Havana', 'America/Hermosillo', 'America/Indiana/Indianapolis', 'America/Indiana/Knox', 'America/Indiana/Marengo', 'America/Indiana/Petersburg', 'America/Indiana/Tell_City', 'America/Indiana/Vevay', 'America/Indiana/Vincennes', 'America/Indiana/Winamac', 'America/Indianapolis', 'America/Inuvik', 'America/Iqaluit', 'America/Jamaica', 'America/Jujuy', 'America/Juneau', 'America/Kentucky/Louisville', 'America/Kentucky/Monticello', 'America/Knox_IN', 'America/Kralendijk', 'America/La_Paz', 'America/Lima', 'America/Los_Angeles', 'America/Louisville', 'America/Lower_Princes', 'America/Maceio', 'America/Managua', 'America/Manaus', 'America/Marigot', 'America/Martinique', 'America/Matamoros', 'America/Mazatlan', 'America/Mendoza', 'America/Menominee', 'America/Merida', 'America/Metlakatla', 'America/Mexico_City', 'America/Miquelon', 'America/Moncton', 'America/Monterrey', 'America/Montevideo', 'America/Montreal', 'America/Montserrat', 'America/Nassau', 'America/New_York', 'America/Nipigon', 'America/Nome', 'America/Noronha', 'America/North_Dakota/Beulah', 'America/North_Dakota/Center', 'America/North_Dakota/New_Salem', 'America/Nuuk', 'America/Ojinaga', 'America/Panama', 'America/Pangnirtung', 'America/Paramaribo', 'America/Phoenix', 'America/Port-au-Prince', 'America/Port_of_Spain', 'America/Porto_Acre', 'America/Porto_Velho', 'America/Puerto_Rico', 'America/Punta_Arenas', 'America/Rainy_River', 'America/Rankin_Inlet', 'America/Recife', 'America/Regina', 'America/Resolute', 'America/Rio_Branco', 'America/Rosario', 'America/Santa_Isabel', 'America/Santarem', 'America/Santiago', 'America/Santo_Domingo', 'America/Sao_Paulo', 'America/Scoresbysund', 'America/Shiprock', 'America/Sitka', 'America/St_Barthelemy', 'America/St_Johns', 'America/St_Kitts', 'America/St_Lucia', 'America/St_Thomas', 'America/St_Vincent', 'America/Swift_Current', 'America/Tegucigalpa', 'America/Thule', 'America/Thunder_Bay', 'America/Tijuana', 'America/Toronto', 'America/Tortola', 'America/Vancouver', 'America/Virgin', 'America/Whitehorse', 'America/Winnipeg', 'America/Yakutat', 'America/Yellowknife', 'Antarctica/Casey', 'Antarctica/Davis', 'Antarctica/DumontDUrville', 'Antarctica/Macquarie', 'Antarctica/Mawson', 'Antarctica/McMurdo', 'Antarctica/Palmer', 'Antarctica/Rothera', 'Antarctica/South_Pole', 'Antarctica/Syowa', 'Antarctica/Troll', 'Antarctica/Vostok', 'Arctic/Longyearbyen', 'Asia/Aden', 'Asia/Almaty', 'Asia/Amman', 'Asia/Anadyr', 'Asia/Aqtau', 'Asia/Aqtobe', 'Asia/Ashgabat', 'Asia/Ashkhabad', 'Asia/Atyrau', 'Asia/Baghdad', 'Asia/Bahrain', 'Asia/Baku', 'Asia/Bangkok', 'Asia/Barnaul', 'Asia/Beirut', 'Asia/Bishkek', 'Asia/Brunei', 'Asia/Calcutta', 'Asia/Chita', 'Asia/Choibalsan', 'Asia/Chongqing', 'Asia/Chungking', 'Asia/Colombo', 'Asia/Dacca', 'Asia/Damascus', 'Asia/Dhaka', 'Asia/Dili', 'Asia/Dubai', 'Asia/Dushanbe', 'Asia/Famagusta', 'Asia/Gaza', 'Asia/Harbin', 'Asia/Hebron', 'Asia/Ho_Chi_Minh', 'Asia/Hong_Kong', 'Asia/Hovd', 'Asia/Irkutsk', 'Asia/Istanbul', 'Asia/Jakarta', 'Asia/Jayapura', 'Asia/Jerusalem', 'Asia/Kabul', 'Asia/Kamchatka', 'Asia/Karachi', 'Asia/Kashgar', 'Asia/Kathmandu', 'Asia/Katmandu', 'Asia/Khandyga', 'Asia/Kolkata', 'Asia/Krasnoyarsk', 'Asia/Kuala_Lumpur', 'Asia/Kuching', 'Asia/Kuwait', 'Asia/Macao', 'Asia/Macau', 'Asia/Magadan', 'Asia/Makassar', 'Asia/Manila', 'Asia/Muscat', 'Asia/Nicosia', 'Asia/Novokuznetsk', 'Asia/Novosibirsk', 'Asia/Omsk', 'Asia/Oral', 'Asia/Phnom_Penh', 'Asia/Pontianak', 'Asia/Pyongyang', 'Asia/Qatar', 'Asia/Qostanay', 'Asia/Qyzylorda', 'Asia/Rangoon', 'Asia/Riyadh', 'Asia/Saigon', 'Asia/Sakhalin', 'Asia/Samarkand', 'Asia/Seoul', 'Asia/Shanghai', 'Asia/Singapore', 'Asia/Srednekolymsk', 'Asia/Taipei', 'Asia/Tashkent', 'Asia/Tbilisi', 'Asia/Tehran', 'Asia/Tel_Aviv', 'Asia/Thimbu', 'Asia/Thimphu', 'Asia/Tokyo', 'Asia/Tomsk', 'Asia/Ujung_Pandang', 'Asia/Ulaanbaatar', 'Asia/Ulan_Bator', 'Asia/Urumqi', 'Asia/Ust-Nera', 'Asia/Vientiane', 'Asia/Vladivostok', 'Asia/Yakutsk', 'Asia/Yangon', 'Asia/Yekaterinburg', 'Asia/Yerevan', 'Atlantic/Azores', 'Atlantic/Bermuda', 'Atlantic/Canary', 'Atlantic/Cape_Verde', 'Atlantic/Faeroe', 'Atlantic/Faroe', 'Atlantic/Jan_Mayen', 'Atlantic/Madeira', 'Atlantic/Reykjavik', 'Atlantic/South_Georgia', 'Atlantic/St_Helena', 'Atlantic/Stanley', 'Australia/ACT', 'Australia/Adelaide', 'Australia/Brisbane', 'Australia/Broken_Hill', 'Australia/Canberra', 'Australia/Currie', 'Australia/Darwin', 'Australia/Eucla', 'Australia/Hobart', 'Australia/LHI', 'Australia/Lindeman', 'Australia/Lord_Howe', 'Australia/Melbourne', 'Australia/NSW', 'Australia/North', 'Australia/Perth', 'Australia/Queensland', 'Australia/South', 'Australia/Sydney', 'Australia/Tasmania', 'Australia/Victoria', 'Australia/West', 'Australia/Yancowinna', 'Brazil/Acre', 'Brazil/DeNoronha', 'Brazil/East', 'Brazil/West', 'CET', 'CST6CDT', 'Canada/Atlantic', 'Canada/Central', 'Canada/Eastern', 'Canada/Mountain', 'Canada/Newfoundland', 'Canada/Pacific', 'Canada/Saskatchewan', 'Canada/Yukon', 'Chile/Continental', 'Chile/EasterIsland', 'Cuba', 'EET', 'EST', 'EST5EDT', 'Egypt', 'Eire', 'Etc/GMT', 'Etc/GMT+0', 'Etc/GMT+1', 'Etc/GMT+10', 'Etc/GMT+11', 'Etc/GMT+12', 'Etc/GMT+2', 'Etc/GMT+3', 'Etc/GMT+4', 'Etc/GMT+5', 'Etc/GMT+6', 'Etc/GMT+7', 'Etc/GMT+8', 'Etc/GMT+9', 'Etc/GMT-0', 'Etc/GMT-1', 'Etc/GMT-10', 'Etc/GMT-11', 'Etc/GMT-12', 'Etc/GMT-13', 'Etc/GMT-14', 'Etc/GMT-2', 'Etc/GMT-3', 'Etc/GMT-4', 'Etc/GMT-5', 'Etc/GMT-6', 'Etc/GMT-7', 'Etc/GMT-8', 'Etc/GMT-9', 'Etc/GMT0', 'Etc/Greenwich', 'Etc/UCT', 'Etc/UTC', 'Etc/Universal', 'Etc/Zulu', 'Europe/Amsterdam', 'Europe/Andorra', 'Europe/Astrakhan', 'Europe/Athens', 'Europe/Belfast', 'Europe/Belgrade', 'Europe/Berlin', 'Europe/Bratislava', 'Europe/Brussels', 'Europe/Bucharest', 'Europe/Budapest', 'Europe/Busingen', 'Europe/Chisinau', 'Europe/Copenhagen', 'Europe/Dublin', 'Europe/Gibraltar', 'Europe/Guernsey', 'Europe/Helsinki', 'Europe/Isle_of_Man', 'Europe/Istanbul', 'Europe/Jersey', 'Europe/Kaliningrad', 'Europe/Kiev', 'Europe/Kirov', 'Europe/Kyiv', 'Europe/Lisbon', 'Europe/Ljubljana', 'Europe/London', 'Europe/Luxembourg', 'Europe/Madrid', 'Europe/Malta', 'Europe/Mariehamn', 'Europe/Minsk', 'Europe/Monaco', 'Europe/Moscow', 'Europe/Nicosia', 'Europe/Oslo', 'Europe/Paris', 'Europe/Podgorica', 'Europe/Prague', 'Europe/Riga', 'Europe/Rome', 'Europe/Samara', 'Europe/San_Marino', 'Europe/Sarajevo', 'Europe/Saratov', 'Europe/Simferopol', 'Europe/Skopje', 'Europe/Sofia', 'Europe/Stockholm', 'Europe/Tallinn', 'Europe/Tirane', 'Europe/Tiraspol', 'Europe/Ulyanovsk', 'Europe/Uzhgorod', 'Europe/Vaduz', 'Europe/Vatican', 'Europe/Vienna', 'Europe/Vilnius', 'Europe/Volgograd', 'Europe/Warsaw', 'Europe/Zagreb', 'Europe/Zaporozhye', 'Europe/Zurich', 'GB', 'GB-Eire', 'GMT', 'GMT+0', 'GMT-0', 'GMT0', 'Greenwich', 'HST', 'Hongkong', 'Iceland', 'Indian/Antananarivo', 'Indian/Chagos', 'Indian/Christmas', 'Indian/Cocos', 'Indian/Comoro', 'Indian/Kerguelen', 'Indian/Mahe', 'Indian/Maldives', 'Indian/Mauritius', 'Indian/Mayotte', 'Indian/Reunion', 'Iran', 'Israel', 'Jamaica', 'Japan', 'Kwajalein', 'Libya', 'MET', 'MST', 'MST7MDT', 'Mexico/BajaNorte', 'Mexico/BajaSur', 'Mexico/General', 'NZ', 'NZ-CHAT', 'Navajo', 'PRC', 'PST8PDT', 'Pacific/Apia', 'Pacific/Auckland', 'Pacific/Bougainville', 'Pacific/Chatham', 'Pacific/Chuuk', 'Pacific/Easter', 'Pacific/Efate', 'Pacific/Enderbury', 'Pacific/Fakaofo', 'Pacific/Fiji', 'Pacific/Funafuti', 'Pacific/Galapagos', 'Pacific/Gambier', 'Pacific/Guadalcanal', 'Pacific/Guam', 'Pacific/Honolulu', 'Pacific/Johnston', 'Pacific/Kanton', 'Pacific/Kiritimati', 'Pacific/Kosrae', 'Pacific/Kwajalein', 'Pacific/Majuro', 'Pacific/Marquesas', 'Pacific/Midway', 'Pacific/Nauru', 'Pacific/Niue', 'Pacific/Norfolk', 'Pacific/Noumea', 'Pacific/Pago_Pago', 'Pacific/Palau', 'Pacific/Pitcairn', 'Pacific/Pohnpei', 'Pacific/Ponape', 'Pacific/Port_Moresby', 'Pacific/Rarotonga', 'Pacific/Saipan', 'Pacific/Samoa', 'Pacific/Tahiti', 'Pacific/Tarawa', 'Pacific/Tongatapu', 'Pacific/Truk', 'Pacific/Wake', 'Pacific/Wallis', 'Pacific/Yap', 'Poland', 'Portugal', 'ROC', 'ROK', 'Singapore', 'Turkey', 'UCT', 'US/Alaska', 'US/Aleutian', 'US/Arizona', 'US/Central', 'US/East-Indiana', 'US/Eastern', 'US/Hawaii', 'US/Indiana-Starke', 'US/Michigan', 'US/Mountain', 'US/Pacific', 'US/Samoa', 'UTC', 'Universal', 'W-SU', 'WET', 'Zulu']", + ("modules", "pytz", "all_timezones_set"): { + "Africa/Abidjan", + "Africa/Accra", + "Africa/Addis_Ababa", + "Africa/Algiers", + "Africa/Asmara", + "Africa/Asmera", + "Africa/Bamako", + "Africa/Bangui", + "Africa/Banjul", + "Africa/Bissau", + "Africa/Blantyre", + "Africa/Brazzaville", + "Africa/Bujumbura", + "Africa/Cairo", + "Africa/Casablanca", + "Africa/Ceuta", + "Africa/Conakry", + "Africa/Dakar", + "Africa/Dar_es_Salaam", + "Africa/Djibouti", + "Africa/Douala", + "Africa/El_Aaiun", + "Africa/Freetown", + "Africa/Gaborone", + "Africa/Harare", + "Africa/Johannesburg", + "Africa/Juba", + "Africa/Kampala", + "Africa/Khartoum", + "Africa/Kigali", + "Africa/Kinshasa", + "Africa/Lagos", + "Africa/Libreville", + "Africa/Lome", + "Africa/Luanda", + "Africa/Lubumbashi", + "Africa/Lusaka", + "Africa/Malabo", + "Africa/Maputo", + "Africa/Maseru", + "Africa/Mbabane", + "Africa/Mogadishu", + "Africa/Monrovia", + "Africa/Nairobi", + "Africa/Ndjamena", + "Africa/Niamey", + "Africa/Nouakchott", + "Africa/Ouagadougou", + "Africa/Porto-Novo", + "Africa/Sao_Tome", + "Africa/Timbuktu", + "Africa/Tripoli", + "Africa/Tunis", + "Africa/Windhoek", + "America/Adak", + "America/Anchorage", + "America/Anguilla", + "America/Antigua", + "America/Araguaina", + "America/Argentina/Buenos_Aires", + "America/Argentina/Catamarca", + "America/Argentina/ComodRivadavia", + "America/Argentina/Cordoba", + "America/Argentina/Jujuy", + "America/Argentina/La_Rioja", + "America/Argentina/Mendoza", + "America/Argentina/Rio_Gallegos", + "America/Argentina/Salta", + "America/Argentina/San_Juan", + "America/Argentina/San_Luis", + "America/Argentina/Tucuman", + "America/Argentina/Ushuaia", + "America/Aruba", + "America/Asuncion", + "America/Atikokan", + "America/Atka", + "America/Bahia", + "America/Bahia_Banderas", + "America/Barbados", + "America/Belem", + "America/Belize", + "America/Blanc-Sablon", + "America/Boa_Vista", + "America/Bogota", + "America/Boise", + "America/Buenos_Aires", + "America/Cambridge_Bay", + "America/Campo_Grande", + "America/Cancun", + "America/Caracas", + "America/Catamarca", + "America/Cayenne", + "America/Cayman", + "America/Chicago", + "America/Chihuahua", + "America/Ciudad_Juarez", + "America/Coral_Harbour", + "America/Cordoba", + "America/Costa_Rica", + "America/Creston", + "America/Cuiaba", + "America/Curacao", + "America/Danmarkshavn", + "America/Dawson", + "America/Dawson_Creek", + "America/Denver", + "America/Detroit", + "America/Dominica", + "America/Edmonton", + "America/Eirunepe", + "America/El_Salvador", + "America/Ensenada", + "America/Fort_Nelson", + "America/Fort_Wayne", + "America/Fortaleza", + "America/Glace_Bay", + "America/Godthab", + "America/Goose_Bay", + "America/Grand_Turk", + "America/Grenada", + "America/Guadeloupe", + "America/Guatemala", + "America/Guayaquil", + "America/Guyana", + "America/Halifax", + "America/Havana", + "America/Hermosillo", + "America/Indiana/Indianapolis", + "America/Indiana/Knox", + "America/Indiana/Marengo", + "America/Indiana/Petersburg", + "America/Indiana/Tell_City", + "America/Indiana/Vevay", + "America/Indiana/Vincennes", + "America/Indiana/Winamac", + "America/Indianapolis", + "America/Inuvik", + "America/Iqaluit", + "America/Jamaica", + "America/Jujuy", + "America/Juneau", + "America/Kentucky/Louisville", + "America/Kentucky/Monticello", + "America/Knox_IN", + "America/Kralendijk", + "America/La_Paz", + "America/Lima", + "America/Los_Angeles", + "America/Louisville", + "America/Lower_Princes", + "America/Maceio", + "America/Managua", + "America/Manaus", + "America/Marigot", + "America/Martinique", + "America/Matamoros", + "America/Mazatlan", + "America/Mendoza", + "America/Menominee", + "America/Merida", + "America/Metlakatla", + "America/Mexico_City", + "America/Miquelon", + "America/Moncton", + "America/Monterrey", + "America/Montevideo", + "America/Montreal", + "America/Montserrat", + "America/Nassau", + "America/New_York", + "America/Nipigon", + "America/Nome", + "America/Noronha", + "America/North_Dakota/Beulah", + "America/North_Dakota/Center", + "America/North_Dakota/New_Salem", + "America/Nuuk", + "America/Ojinaga", + "America/Panama", + "America/Pangnirtung", + "America/Paramaribo", + "America/Phoenix", + "America/Port-au-Prince", + "America/Port_of_Spain", + "America/Porto_Acre", + "America/Porto_Velho", + "America/Puerto_Rico", + "America/Punta_Arenas", + "America/Rainy_River", + "America/Rankin_Inlet", + "America/Recife", + "America/Regina", + "America/Resolute", + "America/Rio_Branco", + "America/Rosario", + "America/Santa_Isabel", + "America/Santarem", + "America/Santiago", + "America/Santo_Domingo", + "America/Sao_Paulo", + "America/Scoresbysund", + "America/Shiprock", + "America/Sitka", + "America/St_Barthelemy", + "America/St_Johns", + "America/St_Kitts", + "America/St_Lucia", + "America/St_Thomas", + "America/St_Vincent", + "America/Swift_Current", + "America/Tegucigalpa", + "America/Thule", + "America/Thunder_Bay", + "America/Tijuana", + "America/Toronto", + "America/Tortola", + "America/Vancouver", + "America/Virgin", + "America/Whitehorse", + "America/Winnipeg", + "America/Yakutat", + "America/Yellowknife", + "Antarctica/Casey", + "Antarctica/Davis", + "Antarctica/DumontDUrville", + "Antarctica/Macquarie", + "Antarctica/Mawson", + "Antarctica/McMurdo", + "Antarctica/Palmer", + "Antarctica/Rothera", + "Antarctica/South_Pole", + "Antarctica/Syowa", + "Antarctica/Troll", + "Antarctica/Vostok", + "Arctic/Longyearbyen", + "Asia/Aden", + "Asia/Almaty", + "Asia/Amman", + "Asia/Anadyr", + "Asia/Aqtau", + "Asia/Aqtobe", + "Asia/Ashgabat", + "Asia/Ashkhabad", + "Asia/Atyrau", + "Asia/Baghdad", + "Asia/Bahrain", + "Asia/Baku", + "Asia/Bangkok", + "Asia/Barnaul", + "Asia/Beirut", + "Asia/Bishkek", + "Asia/Brunei", + "Asia/Calcutta", + "Asia/Chita", + "Asia/Choibalsan", + "Asia/Chongqing", + "Asia/Chungking", + "Asia/Colombo", + "Asia/Dacca", + "Asia/Damascus", + "Asia/Dhaka", + "Asia/Dili", + "Asia/Dubai", + "Asia/Dushanbe", + "Asia/Famagusta", + "Asia/Gaza", + "Asia/Harbin", + "Asia/Hebron", + "Asia/Ho_Chi_Minh", + "Asia/Hong_Kong", + "Asia/Hovd", + "Asia/Irkutsk", + "Asia/Istanbul", + "Asia/Jakarta", + "Asia/Jayapura", + "Asia/Jerusalem", + "Asia/Kabul", + "Asia/Kamchatka", + "Asia/Karachi", + "Asia/Kashgar", + "Asia/Kathmandu", + "Asia/Katmandu", + "Asia/Khandyga", + "Asia/Kolkata", + "Asia/Krasnoyarsk", + "Asia/Kuala_Lumpur", + "Asia/Kuching", + "Asia/Kuwait", + "Asia/Macao", + "Asia/Macau", + "Asia/Magadan", + "Asia/Makassar", + "Asia/Manila", + "Asia/Muscat", + "Asia/Nicosia", + "Asia/Novokuznetsk", + "Asia/Novosibirsk", + "Asia/Omsk", + "Asia/Oral", + "Asia/Phnom_Penh", + "Asia/Pontianak", + "Asia/Pyongyang", + "Asia/Qatar", + "Asia/Qostanay", + "Asia/Qyzylorda", + "Asia/Rangoon", + "Asia/Riyadh", + "Asia/Saigon", + "Asia/Sakhalin", + "Asia/Samarkand", + "Asia/Seoul", + "Asia/Shanghai", + "Asia/Singapore", + "Asia/Srednekolymsk", + "Asia/Taipei", + "Asia/Tashkent", + "Asia/Tbilisi", + "Asia/Tehran", + "Asia/Tel_Aviv", + "Asia/Thimbu", + "Asia/Thimphu", + "Asia/Tokyo", + "Asia/Tomsk", + "Asia/Ujung_Pandang", + "Asia/Ulaanbaatar", + "Asia/Ulan_Bator", + "Asia/Urumqi", + "Asia/Ust-Nera", + "Asia/Vientiane", + "Asia/Vladivostok", + "Asia/Yakutsk", + "Asia/Yangon", + "Asia/Yekaterinburg", + "Asia/Yerevan", + "Atlantic/Azores", + "Atlantic/Bermuda", + "Atlantic/Canary", + "Atlantic/Cape_Verde", + "Atlantic/Faeroe", + "Atlantic/Faroe", + "Atlantic/Jan_Mayen", + "Atlantic/Madeira", + "Atlantic/Reykjavik", + "Atlantic/South_Georgia", + "Atlantic/St_Helena", + "Atlantic/Stanley", + "Australia/ACT", + "Australia/Adelaide", + "Australia/Brisbane", + "Australia/Broken_Hill", + "Australia/Canberra", + "Australia/Currie", + "Australia/Darwin", + "Australia/Eucla", + "Australia/Hobart", + "Australia/LHI", + "Australia/Lindeman", + "Australia/Lord_Howe", + "Australia/Melbourne", + "Australia/NSW", + "Australia/North", + "Australia/Perth", + "Australia/Queensland", + "Australia/South", + "Australia/Sydney", + "Australia/Tasmania", + "Australia/Victoria", + "Australia/West", + "Australia/Yancowinna", + "Brazil/Acre", + "Brazil/DeNoronha", + "Brazil/East", + "Brazil/West", + "CET", + "CST6CDT", + "Canada/Atlantic", + "Canada/Central", + "Canada/Eastern", + "Canada/Mountain", + "Canada/Newfoundland", + "Canada/Pacific", + "Canada/Saskatchewan", + "Canada/Yukon", + "Chile/Continental", + "Chile/EasterIsland", + "Cuba", + "EET", + "EST", + "EST5EDT", + "Egypt", + "Eire", + "Etc/GMT", + "Etc/GMT+0", + "Etc/GMT+1", + "Etc/GMT+10", + "Etc/GMT+11", + "Etc/GMT+12", + "Etc/GMT+2", + "Etc/GMT+3", + "Etc/GMT+4", + "Etc/GMT+5", + "Etc/GMT+6", + "Etc/GMT+7", + "Etc/GMT+8", + "Etc/GMT+9", + "Etc/GMT-0", + "Etc/GMT-1", + "Etc/GMT-10", + "Etc/GMT-11", + "Etc/GMT-12", + "Etc/GMT-13", + "Etc/GMT-14", + "Etc/GMT-2", + "Etc/GMT-3", + "Etc/GMT-4", + "Etc/GMT-5", + "Etc/GMT-6", + "Etc/GMT-7", + "Etc/GMT-8", + "Etc/GMT-9", + "Etc/GMT0", + "Etc/Greenwich", + "Etc/UCT", + "Etc/UTC", + "Etc/Universal", + "Etc/Zulu", + "Europe/Amsterdam", + "Europe/Andorra", + "Europe/Astrakhan", + "Europe/Athens", + "Europe/Belfast", + "Europe/Belgrade", + "Europe/Berlin", + "Europe/Bratislava", + "Europe/Brussels", + "Europe/Bucharest", + "Europe/Budapest", + "Europe/Busingen", + "Europe/Chisinau", + "Europe/Copenhagen", + "Europe/Dublin", + "Europe/Gibraltar", + "Europe/Guernsey", + "Europe/Helsinki", + "Europe/Isle_of_Man", + "Europe/Istanbul", + "Europe/Jersey", + "Europe/Kaliningrad", + "Europe/Kiev", + "Europe/Kirov", + "Europe/Kyiv", + "Europe/Lisbon", + "Europe/Ljubljana", + "Europe/London", + "Europe/Luxembourg", + "Europe/Madrid", + "Europe/Malta", + "Europe/Mariehamn", + "Europe/Minsk", + "Europe/Monaco", + "Europe/Moscow", + "Europe/Nicosia", + "Europe/Oslo", + "Europe/Paris", + "Europe/Podgorica", + "Europe/Prague", + "Europe/Riga", + "Europe/Rome", + "Europe/Samara", + "Europe/San_Marino", + "Europe/Sarajevo", + "Europe/Saratov", + "Europe/Simferopol", + "Europe/Skopje", + "Europe/Sofia", + "Europe/Stockholm", + "Europe/Tallinn", + "Europe/Tirane", + "Europe/Tiraspol", + "Europe/Ulyanovsk", + "Europe/Uzhgorod", + "Europe/Vaduz", + "Europe/Vatican", + "Europe/Vienna", + "Europe/Vilnius", + "Europe/Volgograd", + "Europe/Warsaw", + "Europe/Zagreb", + "Europe/Zaporozhye", + "Europe/Zurich", + "GB", + "GB-Eire", + "GMT", + "GMT+0", + "GMT-0", + "GMT0", + "Greenwich", + "HST", + "Hongkong", + "Iceland", + "Indian/Antananarivo", + "Indian/Chagos", + "Indian/Christmas", + "Indian/Cocos", + "Indian/Comoro", + "Indian/Kerguelen", + "Indian/Mahe", + "Indian/Maldives", + "Indian/Mauritius", + "Indian/Mayotte", + "Indian/Reunion", + "Iran", + "Israel", + "Jamaica", + "Japan", + "Kwajalein", + "Libya", + "MET", + "MST", + "MST7MDT", + "Mexico/BajaNorte", + "Mexico/BajaSur", + "Mexico/General", + "NZ", + "NZ-CHAT", + "Navajo", + "PRC", + "PST8PDT", + "Pacific/Apia", + "Pacific/Auckland", + "Pacific/Bougainville", + "Pacific/Chatham", + "Pacific/Chuuk", + "Pacific/Easter", + "Pacific/Efate", + "Pacific/Enderbury", + "Pacific/Fakaofo", + "Pacific/Fiji", + "Pacific/Funafuti", + "Pacific/Galapagos", + "Pacific/Gambier", + "Pacific/Guadalcanal", + "Pacific/Guam", + "Pacific/Honolulu", + "Pacific/Johnston", + "Pacific/Kanton", + "Pacific/Kiritimati", + "Pacific/Kosrae", + "Pacific/Kwajalein", + "Pacific/Majuro", + "Pacific/Marquesas", + "Pacific/Midway", + "Pacific/Nauru", + "Pacific/Niue", + "Pacific/Norfolk", + "Pacific/Noumea", + "Pacific/Pago_Pago", + "Pacific/Palau", + "Pacific/Pitcairn", + "Pacific/Pohnpei", + "Pacific/Ponape", + "Pacific/Port_Moresby", + "Pacific/Rarotonga", + "Pacific/Saipan", + "Pacific/Samoa", + "Pacific/Tahiti", + "Pacific/Tarawa", + "Pacific/Tongatapu", + "Pacific/Truk", + "Pacific/Wake", + "Pacific/Wallis", + "Pacific/Yap", + "Poland", + "Portugal", + "ROC", + "ROK", + "Singapore", + "Turkey", + "UCT", + "US/Alaska", + "US/Aleutian", + "US/Arizona", + "US/Central", + "US/East-Indiana", + "US/Eastern", + "US/Hawaii", + "US/Indiana-Starke", + "US/Michigan", + "US/Mountain", + "US/Pacific", + "US/Samoa", + "UTC", + "Universal", + "W-SU", + "WET", + "Zulu", + }, + ( + "modules", + "pytz", + "common_timezones", + ): "['Africa/Abidjan', 'Africa/Accra', 'Africa/Addis_Ababa', 'Africa/Algiers', 'Africa/Asmara', 'Africa/Bamako', 'Africa/Bangui', 'Africa/Banjul', 'Africa/Bissau', 'Africa/Blantyre', 'Africa/Brazzaville', 'Africa/Bujumbura', 'Africa/Cairo', 'Africa/Casablanca', 'Africa/Ceuta', 'Africa/Conakry', 'Africa/Dakar', 'Africa/Dar_es_Salaam', 'Africa/Djibouti', 'Africa/Douala', 'Africa/El_Aaiun', 'Africa/Freetown', 'Africa/Gaborone', 'Africa/Harare', 'Africa/Johannesburg', 'Africa/Juba', 'Africa/Kampala', 'Africa/Khartoum', 'Africa/Kigali', 'Africa/Kinshasa', 'Africa/Lagos', 'Africa/Libreville', 'Africa/Lome', 'Africa/Luanda', 'Africa/Lubumbashi', 'Africa/Lusaka', 'Africa/Malabo', 'Africa/Maputo', 'Africa/Maseru', 'Africa/Mbabane', 'Africa/Mogadishu', 'Africa/Monrovia', 'Africa/Nairobi', 'Africa/Ndjamena', 'Africa/Niamey', 'Africa/Nouakchott', 'Africa/Ouagadougou', 'Africa/Porto-Novo', 'Africa/Sao_Tome', 'Africa/Tripoli', 'Africa/Tunis', 'Africa/Windhoek', 'America/Adak', 'America/Anchorage', 'America/Anguilla', 'America/Antigua', 'America/Araguaina', 'America/Argentina/Buenos_Aires', 'America/Argentina/Catamarca', 'America/Argentina/Cordoba', 'America/Argentina/Jujuy', 'America/Argentina/La_Rioja', 'America/Argentina/Mendoza', 'America/Argentina/Rio_Gallegos', 'America/Argentina/Salta', 'America/Argentina/San_Juan', 'America/Argentina/San_Luis', 'America/Argentina/Tucuman', 'America/Argentina/Ushuaia', 'America/Aruba', 'America/Asuncion', 'America/Atikokan', 'America/Bahia', 'America/Bahia_Banderas', 'America/Barbados', 'America/Belem', 'America/Belize', 'America/Blanc-Sablon', 'America/Boa_Vista', 'America/Bogota', 'America/Boise', 'America/Cambridge_Bay', 'America/Campo_Grande', 'America/Cancun', 'America/Caracas', 'America/Cayenne', 'America/Cayman', 'America/Chicago', 'America/Chihuahua', 'America/Ciudad_Juarez', 'America/Costa_Rica', 'America/Creston', 'America/Cuiaba', 'America/Curacao', 'America/Danmarkshavn', 'America/Dawson', 'America/Dawson_Creek', 'America/Denver', 'America/Detroit', 'America/Dominica', 'America/Edmonton', 'America/Eirunepe', 'America/El_Salvador', 'America/Fort_Nelson', 'America/Fortaleza', 'America/Glace_Bay', 'America/Goose_Bay', 'America/Grand_Turk', 'America/Grenada', 'America/Guadeloupe', 'America/Guatemala', 'America/Guayaquil', 'America/Guyana', 'America/Halifax', 'America/Havana', 'America/Hermosillo', 'America/Indiana/Indianapolis', 'America/Indiana/Knox', 'America/Indiana/Marengo', 'America/Indiana/Petersburg', 'America/Indiana/Tell_City', 'America/Indiana/Vevay', 'America/Indiana/Vincennes', 'America/Indiana/Winamac', 'America/Inuvik', 'America/Iqaluit', 'America/Jamaica', 'America/Juneau', 'America/Kentucky/Louisville', 'America/Kentucky/Monticello', 'America/Kralendijk', 'America/La_Paz', 'America/Lima', 'America/Los_Angeles', 'America/Lower_Princes', 'America/Maceio', 'America/Managua', 'America/Manaus', 'America/Marigot', 'America/Martinique', 'America/Matamoros', 'America/Mazatlan', 'America/Menominee', 'America/Merida', 'America/Metlakatla', 'America/Mexico_City', 'America/Miquelon', 'America/Moncton', 'America/Monterrey', 'America/Montevideo', 'America/Montserrat', 'America/Nassau', 'America/New_York', 'America/Nome', 'America/Noronha', 'America/North_Dakota/Beulah', 'America/North_Dakota/Center', 'America/North_Dakota/New_Salem', 'America/Nuuk', 'America/Ojinaga', 'America/Panama', 'America/Paramaribo', 'America/Phoenix', 'America/Port-au-Prince', 'America/Port_of_Spain', 'America/Porto_Velho', 'America/Puerto_Rico', 'America/Punta_Arenas', 'America/Rankin_Inlet', 'America/Recife', 'America/Regina', 'America/Resolute', 'America/Rio_Branco', 'America/Santarem', 'America/Santiago', 'America/Santo_Domingo', 'America/Sao_Paulo', 'America/Scoresbysund', 'America/Sitka', 'America/St_Barthelemy', 'America/St_Johns', 'America/St_Kitts', 'America/St_Lucia', 'America/St_Thomas', 'America/St_Vincent', 'America/Swift_Current', 'America/Tegucigalpa', 'America/Thule', 'America/Tijuana', 'America/Toronto', 'America/Tortola', 'America/Vancouver', 'America/Whitehorse', 'America/Winnipeg', 'America/Yakutat', 'Antarctica/Casey', 'Antarctica/Davis', 'Antarctica/DumontDUrville', 'Antarctica/Macquarie', 'Antarctica/Mawson', 'Antarctica/McMurdo', 'Antarctica/Palmer', 'Antarctica/Rothera', 'Antarctica/Syowa', 'Antarctica/Troll', 'Antarctica/Vostok', 'Arctic/Longyearbyen', 'Asia/Aden', 'Asia/Almaty', 'Asia/Amman', 'Asia/Anadyr', 'Asia/Aqtau', 'Asia/Aqtobe', 'Asia/Ashgabat', 'Asia/Atyrau', 'Asia/Baghdad', 'Asia/Bahrain', 'Asia/Baku', 'Asia/Bangkok', 'Asia/Barnaul', 'Asia/Beirut', 'Asia/Bishkek', 'Asia/Brunei', 'Asia/Chita', 'Asia/Choibalsan', 'Asia/Colombo', 'Asia/Damascus', 'Asia/Dhaka', 'Asia/Dili', 'Asia/Dubai', 'Asia/Dushanbe', 'Asia/Famagusta', 'Asia/Gaza', 'Asia/Hebron', 'Asia/Ho_Chi_Minh', 'Asia/Hong_Kong', 'Asia/Hovd', 'Asia/Irkutsk', 'Asia/Jakarta', 'Asia/Jayapura', 'Asia/Jerusalem', 'Asia/Kabul', 'Asia/Kamchatka', 'Asia/Karachi', 'Asia/Kathmandu', 'Asia/Khandyga', 'Asia/Kolkata', 'Asia/Krasnoyarsk', 'Asia/Kuala_Lumpur', 'Asia/Kuching', 'Asia/Kuwait', 'Asia/Macau', 'Asia/Magadan', 'Asia/Makassar', 'Asia/Manila', 'Asia/Muscat', 'Asia/Nicosia', 'Asia/Novokuznetsk', 'Asia/Novosibirsk', 'Asia/Omsk', 'Asia/Oral', 'Asia/Phnom_Penh', 'Asia/Pontianak', 'Asia/Pyongyang', 'Asia/Qatar', 'Asia/Qostanay', 'Asia/Qyzylorda', 'Asia/Riyadh', 'Asia/Sakhalin', 'Asia/Samarkand', 'Asia/Seoul', 'Asia/Shanghai', 'Asia/Singapore', 'Asia/Srednekolymsk', 'Asia/Taipei', 'Asia/Tashkent', 'Asia/Tbilisi', 'Asia/Tehran', 'Asia/Thimphu', 'Asia/Tokyo', 'Asia/Tomsk', 'Asia/Ulaanbaatar', 'Asia/Urumqi', 'Asia/Ust-Nera', 'Asia/Vientiane', 'Asia/Vladivostok', 'Asia/Yakutsk', 'Asia/Yangon', 'Asia/Yekaterinburg', 'Asia/Yerevan', 'Atlantic/Azores', 'Atlantic/Bermuda', 'Atlantic/Canary', 'Atlantic/Cape_Verde', 'Atlantic/Faroe', 'Atlantic/Madeira', 'Atlantic/Reykjavik', 'Atlantic/South_Georgia', 'Atlantic/St_Helena', 'Atlantic/Stanley', 'Australia/Adelaide', 'Australia/Brisbane', 'Australia/Broken_Hill', 'Australia/Darwin', 'Australia/Eucla', 'Australia/Hobart', 'Australia/Lindeman', 'Australia/Lord_Howe', 'Australia/Melbourne', 'Australia/Perth', 'Australia/Sydney', 'Canada/Atlantic', 'Canada/Central', 'Canada/Eastern', 'Canada/Mountain', 'Canada/Newfoundland', 'Canada/Pacific', 'Europe/Amsterdam', 'Europe/Andorra', 'Europe/Astrakhan', 'Europe/Athens', 'Europe/Belgrade', 'Europe/Berlin', 'Europe/Bratislava', 'Europe/Brussels', 'Europe/Bucharest', 'Europe/Budapest', 'Europe/Busingen', 'Europe/Chisinau', 'Europe/Copenhagen', 'Europe/Dublin', 'Europe/Gibraltar', 'Europe/Guernsey', 'Europe/Helsinki', 'Europe/Isle_of_Man', 'Europe/Istanbul', 'Europe/Jersey', 'Europe/Kaliningrad', 'Europe/Kirov', 'Europe/Kyiv', 'Europe/Lisbon', 'Europe/Ljubljana', 'Europe/London', 'Europe/Luxembourg', 'Europe/Madrid', 'Europe/Malta', 'Europe/Mariehamn', 'Europe/Minsk', 'Europe/Monaco', 'Europe/Moscow', 'Europe/Oslo', 'Europe/Paris', 'Europe/Podgorica', 'Europe/Prague', 'Europe/Riga', 'Europe/Rome', 'Europe/Samara', 'Europe/San_Marino', 'Europe/Sarajevo', 'Europe/Saratov', 'Europe/Simferopol', 'Europe/Skopje', 'Europe/Sofia', 'Europe/Stockholm', 'Europe/Tallinn', 'Europe/Tirane', 'Europe/Ulyanovsk', 'Europe/Vaduz', 'Europe/Vatican', 'Europe/Vienna', 'Europe/Vilnius', 'Europe/Volgograd', 'Europe/Warsaw', 'Europe/Zagreb', 'Europe/Zurich', 'GMT', 'Indian/Antananarivo', 'Indian/Chagos', 'Indian/Christmas', 'Indian/Cocos', 'Indian/Comoro', 'Indian/Kerguelen', 'Indian/Mahe', 'Indian/Maldives', 'Indian/Mauritius', 'Indian/Mayotte', 'Indian/Reunion', 'Pacific/Apia', 'Pacific/Auckland', 'Pacific/Bougainville', 'Pacific/Chatham', 'Pacific/Chuuk', 'Pacific/Easter', 'Pacific/Efate', 'Pacific/Fakaofo', 'Pacific/Fiji', 'Pacific/Funafuti', 'Pacific/Galapagos', 'Pacific/Gambier', 'Pacific/Guadalcanal', 'Pacific/Guam', 'Pacific/Honolulu', 'Pacific/Kanton', 'Pacific/Kiritimati', 'Pacific/Kosrae', 'Pacific/Kwajalein', 'Pacific/Majuro', 'Pacific/Marquesas', 'Pacific/Midway', 'Pacific/Nauru', 'Pacific/Niue', 'Pacific/Norfolk', 'Pacific/Noumea', 'Pacific/Pago_Pago', 'Pacific/Palau', 'Pacific/Pitcairn', 'Pacific/Pohnpei', 'Pacific/Port_Moresby', 'Pacific/Rarotonga', 'Pacific/Saipan', 'Pacific/Tahiti', 'Pacific/Tarawa', 'Pacific/Tongatapu', 'Pacific/Wake', 'Pacific/Wallis', 'US/Alaska', 'US/Arizona', 'US/Central', 'US/Eastern', 'US/Hawaii', 'US/Mountain', 'US/Pacific', 'UTC']", + ("modules", "pytz", "common_timezones_set"): set(), + ("modules", "pytz", "BaseTzInfo"): "", + ("modules", "pytz", "FixedOffset"): "", + ("modules", "datetime", "date"): "", + ("modules", "datetime", "datetime"): "", + ("modules", "datetime", "time"): "", + ("modules", "datetime", "timedelta"): "", + ("modules", "datetime", "tzinfo"): "", + ("modules", "re", "match"): "", + ("modules", "re", "fullmatch"): "", + ("modules", "re", "search"): "", + ("modules", "re", "sub"): "", + ("modules", "re", "subn"): "", + ("modules", "re", "split"): "", + ("modules", "re", "findall"): "", + ("modules", "re", "finditer"): "", + ("modules", "re", "compile"): "", + ("modules", "re", "purge"): "", + ("modules", "re", "template"): "", + ("modules", "re", "escape"): "", + ("modules", "re", "error"): "", + ("modules", "re", "Pattern"): "", + ("modules", "re", "Match"): "", + ("modules", "re", "A"): "re.ASCII", + ("modules", "re", "I"): "re.IGNORECASE", + ("modules", "re", "L"): "re.LOCALE", + ("modules", "re", "M"): "re.MULTILINE", + ("modules", "re", "S"): "re.DOTALL", + ("modules", "re", "X"): "re.VERBOSE", + ("modules", "re", "U"): "re.UNICODE", + ("modules", "re", "ASCII"): "re.ASCII", + ("modules", "re", "IGNORECASE"): "re.IGNORECASE", + ("modules", "re", "LOCALE"): "re.LOCALE", + ("modules", "re", "MULTILINE"): "re.MULTILINE", + ("modules", "re", "DOTALL"): "re.DOTALL", + ("modules", "re", "VERBOSE"): "re.VERBOSE", + ("modules", "re", "UNICODE"): "re.UNICODE", + ("modules", "re", "NOFLAG"): "re.NOFLAG", + ("modules", "re", "RegexFlag"): "", + ("modules", "itertools", "count"): "", + ("modules", "itertools", "cycle"): "", + ("modules", "itertools", "repeat"): "", + ("modules", "itertools", "accumulate"): "", + ("modules", "itertools", "chain"): "", + ("modules", "itertools", "compress"): "", + ("modules", "itertools", "islice"): "", + ("modules", "itertools", "starmap"): "", + ("modules", "itertools", "tee"): "", + ("modules", "itertools", "zip_longest"): "", + ("modules", "itertools", "product"): "", + ("modules", "itertools", "permutations"): "", + ("modules", "itertools", "combinations"): "", + ( + "modules", + "itertools", + "combinations_with_replacement", + ): "", + ("invocation_args_dict", "warn_error_options", "include"): "[]", + ("invocation_args_dict", "warn_error_options", "exclude"): "[]", + ("modules", "pytz", "country_timezones", "AD"): "['Europe/Andorra']", + ("modules", "pytz", "country_timezones", "AE"): "['Asia/Dubai']", + ("modules", "pytz", "country_timezones", "AF"): "['Asia/Kabul']", + ("modules", "pytz", "country_timezones", "AG"): "['America/Antigua']", + ("modules", "pytz", "country_timezones", "AI"): "['America/Anguilla']", + ("modules", "pytz", "country_timezones", "AL"): "['Europe/Tirane']", + ("modules", "pytz", "country_timezones", "AM"): "['Asia/Yerevan']", + ("modules", "pytz", "country_timezones", "AO"): "['Africa/Luanda']", + ( + "modules", + "pytz", + "country_timezones", + "AQ", + ): "['Antarctica/McMurdo', 'Antarctica/Casey', 'Antarctica/Davis', 'Antarctica/DumontDUrville', 'Antarctica/Mawson', 'Antarctica/Palmer', 'Antarctica/Rothera', 'Antarctica/Syowa', 'Antarctica/Troll', 'Antarctica/Vostok']", + ( + "modules", + "pytz", + "country_timezones", + "AR", + ): "['America/Argentina/Buenos_Aires', 'America/Argentina/Cordoba', 'America/Argentina/Salta', 'America/Argentina/Jujuy', 'America/Argentina/Tucuman', 'America/Argentina/Catamarca', 'America/Argentina/La_Rioja', 'America/Argentina/San_Juan', 'America/Argentina/Mendoza', 'America/Argentina/San_Luis', 'America/Argentina/Rio_Gallegos', 'America/Argentina/Ushuaia']", + ("modules", "pytz", "country_timezones", "AS"): "['Pacific/Pago_Pago']", + ("modules", "pytz", "country_timezones", "AT"): "['Europe/Vienna']", + ( + "modules", + "pytz", + "country_timezones", + "AU", + ): "['Australia/Lord_Howe', 'Antarctica/Macquarie', 'Australia/Hobart', 'Australia/Melbourne', 'Australia/Sydney', 'Australia/Broken_Hill', 'Australia/Brisbane', 'Australia/Lindeman', 'Australia/Adelaide', 'Australia/Darwin', 'Australia/Perth', 'Australia/Eucla']", + ("modules", "pytz", "country_timezones", "AW"): "['America/Aruba']", + ("modules", "pytz", "country_timezones", "AX"): "['Europe/Mariehamn']", + ("modules", "pytz", "country_timezones", "AZ"): "['Asia/Baku']", + ("modules", "pytz", "country_timezones", "BA"): "['Europe/Sarajevo']", + ("modules", "pytz", "country_timezones", "BB"): "['America/Barbados']", + ("modules", "pytz", "country_timezones", "BD"): "['Asia/Dhaka']", + ("modules", "pytz", "country_timezones", "BE"): "['Europe/Brussels']", + ("modules", "pytz", "country_timezones", "BF"): "['Africa/Ouagadougou']", + ("modules", "pytz", "country_timezones", "BG"): "['Europe/Sofia']", + ("modules", "pytz", "country_timezones", "BH"): "['Asia/Bahrain']", + ("modules", "pytz", "country_timezones", "BI"): "['Africa/Bujumbura']", + ("modules", "pytz", "country_timezones", "BJ"): "['Africa/Porto-Novo']", + ("modules", "pytz", "country_timezones", "BL"): "['America/St_Barthelemy']", + ("modules", "pytz", "country_timezones", "BM"): "['Atlantic/Bermuda']", + ("modules", "pytz", "country_timezones", "BN"): "['Asia/Brunei']", + ("modules", "pytz", "country_timezones", "BO"): "['America/La_Paz']", + ("modules", "pytz", "country_timezones", "BQ"): "['America/Kralendijk']", + ( + "modules", + "pytz", + "country_timezones", + "BR", + ): "['America/Noronha', 'America/Belem', 'America/Fortaleza', 'America/Recife', 'America/Araguaina', 'America/Maceio', 'America/Bahia', 'America/Sao_Paulo', 'America/Campo_Grande', 'America/Cuiaba', 'America/Santarem', 'America/Porto_Velho', 'America/Boa_Vista', 'America/Manaus', 'America/Eirunepe', 'America/Rio_Branco']", + ("modules", "pytz", "country_timezones", "BS"): "['America/Nassau']", + ("modules", "pytz", "country_timezones", "BT"): "['Asia/Thimphu']", + ("modules", "pytz", "country_timezones", "BW"): "['Africa/Gaborone']", + ("modules", "pytz", "country_timezones", "BY"): "['Europe/Minsk']", + ("modules", "pytz", "country_timezones", "BZ"): "['America/Belize']", + ( + "modules", + "pytz", + "country_timezones", + "CA", + ): "['America/St_Johns', 'America/Halifax', 'America/Glace_Bay', 'America/Moncton', 'America/Goose_Bay', 'America/Blanc-Sablon', 'America/Toronto', 'America/Iqaluit', 'America/Atikokan', 'America/Winnipeg', 'America/Resolute', 'America/Rankin_Inlet', 'America/Regina', 'America/Swift_Current', 'America/Edmonton', 'America/Cambridge_Bay', 'America/Inuvik', 'America/Creston', 'America/Dawson_Creek', 'America/Fort_Nelson', 'America/Whitehorse', 'America/Dawson', 'America/Vancouver']", + ("modules", "pytz", "country_timezones", "CC"): "['Indian/Cocos']", + ("modules", "pytz", "country_timezones", "CD"): "['Africa/Kinshasa', 'Africa/Lubumbashi']", + ("modules", "pytz", "country_timezones", "CF"): "['Africa/Bangui']", + ("modules", "pytz", "country_timezones", "CG"): "['Africa/Brazzaville']", + ("modules", "pytz", "country_timezones", "CH"): "['Europe/Zurich']", + ("modules", "pytz", "country_timezones", "CI"): "['Africa/Abidjan']", + ("modules", "pytz", "country_timezones", "CK"): "['Pacific/Rarotonga']", + ( + "modules", + "pytz", + "country_timezones", + "CL", + ): "['America/Santiago', 'America/Punta_Arenas', 'Pacific/Easter']", + ("modules", "pytz", "country_timezones", "CM"): "['Africa/Douala']", + ("modules", "pytz", "country_timezones", "CN"): "['Asia/Shanghai', 'Asia/Urumqi']", + ("modules", "pytz", "country_timezones", "CO"): "['America/Bogota']", + ("modules", "pytz", "country_timezones", "CR"): "['America/Costa_Rica']", + ("modules", "pytz", "country_timezones", "CU"): "['America/Havana']", + ("modules", "pytz", "country_timezones", "CV"): "['Atlantic/Cape_Verde']", + ("modules", "pytz", "country_timezones", "CW"): "['America/Curacao']", + ("modules", "pytz", "country_timezones", "CX"): "['Indian/Christmas']", + ("modules", "pytz", "country_timezones", "CY"): "['Asia/Nicosia', 'Asia/Famagusta']", + ("modules", "pytz", "country_timezones", "CZ"): "['Europe/Prague']", + ("modules", "pytz", "country_timezones", "DE"): "['Europe/Berlin', 'Europe/Busingen']", + ("modules", "pytz", "country_timezones", "DJ"): "['Africa/Djibouti']", + ("modules", "pytz", "country_timezones", "DK"): "['Europe/Copenhagen']", + ("modules", "pytz", "country_timezones", "DM"): "['America/Dominica']", + ("modules", "pytz", "country_timezones", "DO"): "['America/Santo_Domingo']", + ("modules", "pytz", "country_timezones", "DZ"): "['Africa/Algiers']", + ("modules", "pytz", "country_timezones", "EC"): "['America/Guayaquil', 'Pacific/Galapagos']", + ("modules", "pytz", "country_timezones", "EE"): "['Europe/Tallinn']", + ("modules", "pytz", "country_timezones", "EG"): "['Africa/Cairo']", + ("modules", "pytz", "country_timezones", "EH"): "['Africa/El_Aaiun']", + ("modules", "pytz", "country_timezones", "ER"): "['Africa/Asmara']", + ( + "modules", + "pytz", + "country_timezones", + "ES", + ): "['Europe/Madrid', 'Africa/Ceuta', 'Atlantic/Canary']", + ("modules", "pytz", "country_timezones", "ET"): "['Africa/Addis_Ababa']", + ("modules", "pytz", "country_timezones", "FI"): "['Europe/Helsinki']", + ("modules", "pytz", "country_timezones", "FJ"): "['Pacific/Fiji']", + ("modules", "pytz", "country_timezones", "FK"): "['Atlantic/Stanley']", + ( + "modules", + "pytz", + "country_timezones", + "FM", + ): "['Pacific/Chuuk', 'Pacific/Pohnpei', 'Pacific/Kosrae']", + ("modules", "pytz", "country_timezones", "FO"): "['Atlantic/Faroe']", + ("modules", "pytz", "country_timezones", "FR"): "['Europe/Paris']", + ("modules", "pytz", "country_timezones", "GA"): "['Africa/Libreville']", + ("modules", "pytz", "country_timezones", "GB"): "['Europe/London']", + ("modules", "pytz", "country_timezones", "GD"): "['America/Grenada']", + ("modules", "pytz", "country_timezones", "GE"): "['Asia/Tbilisi']", + ("modules", "pytz", "country_timezones", "GF"): "['America/Cayenne']", + ("modules", "pytz", "country_timezones", "GG"): "['Europe/Guernsey']", + ("modules", "pytz", "country_timezones", "GH"): "['Africa/Accra']", + ("modules", "pytz", "country_timezones", "GI"): "['Europe/Gibraltar']", + ( + "modules", + "pytz", + "country_timezones", + "GL", + ): "['America/Nuuk', 'America/Danmarkshavn', 'America/Scoresbysund', 'America/Thule']", + ("modules", "pytz", "country_timezones", "GM"): "['Africa/Banjul']", + ("modules", "pytz", "country_timezones", "GN"): "['Africa/Conakry']", + ("modules", "pytz", "country_timezones", "GP"): "['America/Guadeloupe']", + ("modules", "pytz", "country_timezones", "GQ"): "['Africa/Malabo']", + ("modules", "pytz", "country_timezones", "GR"): "['Europe/Athens']", + ("modules", "pytz", "country_timezones", "GS"): "['Atlantic/South_Georgia']", + ("modules", "pytz", "country_timezones", "GT"): "['America/Guatemala']", + ("modules", "pytz", "country_timezones", "GU"): "['Pacific/Guam']", + ("modules", "pytz", "country_timezones", "GW"): "['Africa/Bissau']", + ("modules", "pytz", "country_timezones", "GY"): "['America/Guyana']", + ("modules", "pytz", "country_timezones", "HK"): "['Asia/Hong_Kong']", + ("modules", "pytz", "country_timezones", "HN"): "['America/Tegucigalpa']", + ("modules", "pytz", "country_timezones", "HR"): "['Europe/Zagreb']", + ("modules", "pytz", "country_timezones", "HT"): "['America/Port-au-Prince']", + ("modules", "pytz", "country_timezones", "HU"): "['Europe/Budapest']", + ( + "modules", + "pytz", + "country_timezones", + "ID", + ): "['Asia/Jakarta', 'Asia/Pontianak', 'Asia/Makassar', 'Asia/Jayapura']", + ("modules", "pytz", "country_timezones", "IE"): "['Europe/Dublin']", + ("modules", "pytz", "country_timezones", "IL"): "['Asia/Jerusalem']", + ("modules", "pytz", "country_timezones", "IM"): "['Europe/Isle_of_Man']", + ("modules", "pytz", "country_timezones", "IN"): "['Asia/Kolkata']", + ("modules", "pytz", "country_timezones", "IO"): "['Indian/Chagos']", + ("modules", "pytz", "country_timezones", "IQ"): "['Asia/Baghdad']", + ("modules", "pytz", "country_timezones", "IR"): "['Asia/Tehran']", + ("modules", "pytz", "country_timezones", "IS"): "['Atlantic/Reykjavik']", + ("modules", "pytz", "country_timezones", "IT"): "['Europe/Rome']", + ("modules", "pytz", "country_timezones", "JE"): "['Europe/Jersey']", + ("modules", "pytz", "country_timezones", "JM"): "['America/Jamaica']", + ("modules", "pytz", "country_timezones", "JO"): "['Asia/Amman']", + ("modules", "pytz", "country_timezones", "JP"): "['Asia/Tokyo']", + ("modules", "pytz", "country_timezones", "KE"): "['Africa/Nairobi']", + ("modules", "pytz", "country_timezones", "KG"): "['Asia/Bishkek']", + ("modules", "pytz", "country_timezones", "KH"): "['Asia/Phnom_Penh']", + ( + "modules", + "pytz", + "country_timezones", + "KI", + ): "['Pacific/Tarawa', 'Pacific/Kanton', 'Pacific/Kiritimati']", + ("modules", "pytz", "country_timezones", "KM"): "['Indian/Comoro']", + ("modules", "pytz", "country_timezones", "KN"): "['America/St_Kitts']", + ("modules", "pytz", "country_timezones", "KP"): "['Asia/Pyongyang']", + ("modules", "pytz", "country_timezones", "KR"): "['Asia/Seoul']", + ("modules", "pytz", "country_timezones", "KW"): "['Asia/Kuwait']", + ("modules", "pytz", "country_timezones", "KY"): "['America/Cayman']", + ( + "modules", + "pytz", + "country_timezones", + "KZ", + ): "['Asia/Almaty', 'Asia/Qyzylorda', 'Asia/Qostanay', 'Asia/Aqtobe', 'Asia/Aqtau', 'Asia/Atyrau', 'Asia/Oral']", + ("modules", "pytz", "country_timezones", "LA"): "['Asia/Vientiane']", + ("modules", "pytz", "country_timezones", "LB"): "['Asia/Beirut']", + ("modules", "pytz", "country_timezones", "LC"): "['America/St_Lucia']", + ("modules", "pytz", "country_timezones", "LI"): "['Europe/Vaduz']", + ("modules", "pytz", "country_timezones", "LK"): "['Asia/Colombo']", + ("modules", "pytz", "country_timezones", "LR"): "['Africa/Monrovia']", + ("modules", "pytz", "country_timezones", "LS"): "['Africa/Maseru']", + ("modules", "pytz", "country_timezones", "LT"): "['Europe/Vilnius']", + ("modules", "pytz", "country_timezones", "LU"): "['Europe/Luxembourg']", + ("modules", "pytz", "country_timezones", "LV"): "['Europe/Riga']", + ("modules", "pytz", "country_timezones", "LY"): "['Africa/Tripoli']", + ("modules", "pytz", "country_timezones", "MA"): "['Africa/Casablanca']", + ("modules", "pytz", "country_timezones", "MC"): "['Europe/Monaco']", + ("modules", "pytz", "country_timezones", "MD"): "['Europe/Chisinau']", + ("modules", "pytz", "country_timezones", "ME"): "['Europe/Podgorica']", + ("modules", "pytz", "country_timezones", "MF"): "['America/Marigot']", + ("modules", "pytz", "country_timezones", "MG"): "['Indian/Antananarivo']", + ("modules", "pytz", "country_timezones", "MH"): "['Pacific/Majuro', 'Pacific/Kwajalein']", + ("modules", "pytz", "country_timezones", "MK"): "['Europe/Skopje']", + ("modules", "pytz", "country_timezones", "ML"): "['Africa/Bamako']", + ("modules", "pytz", "country_timezones", "MM"): "['Asia/Yangon']", + ( + "modules", + "pytz", + "country_timezones", + "MN", + ): "['Asia/Ulaanbaatar', 'Asia/Hovd', 'Asia/Choibalsan']", + ("modules", "pytz", "country_timezones", "MO"): "['Asia/Macau']", + ("modules", "pytz", "country_timezones", "MP"): "['Pacific/Saipan']", + ("modules", "pytz", "country_timezones", "MQ"): "['America/Martinique']", + ("modules", "pytz", "country_timezones", "MR"): "['Africa/Nouakchott']", + ("modules", "pytz", "country_timezones", "MS"): "['America/Montserrat']", + ("modules", "pytz", "country_timezones", "MT"): "['Europe/Malta']", + ("modules", "pytz", "country_timezones", "MU"): "['Indian/Mauritius']", + ("modules", "pytz", "country_timezones", "MV"): "['Indian/Maldives']", + ("modules", "pytz", "country_timezones", "MW"): "['Africa/Blantyre']", + ( + "modules", + "pytz", + "country_timezones", + "MX", + ): "['America/Mexico_City', 'America/Cancun', 'America/Merida', 'America/Monterrey', 'America/Matamoros', 'America/Chihuahua', 'America/Ciudad_Juarez', 'America/Ojinaga', 'America/Mazatlan', 'America/Bahia_Banderas', 'America/Hermosillo', 'America/Tijuana']", + ("modules", "pytz", "country_timezones", "MY"): "['Asia/Kuala_Lumpur', 'Asia/Kuching']", + ("modules", "pytz", "country_timezones", "MZ"): "['Africa/Maputo']", + ("modules", "pytz", "country_timezones", "NA"): "['Africa/Windhoek']", + ("modules", "pytz", "country_timezones", "NC"): "['Pacific/Noumea']", + ("modules", "pytz", "country_timezones", "NE"): "['Africa/Niamey']", + ("modules", "pytz", "country_timezones", "NF"): "['Pacific/Norfolk']", + ("modules", "pytz", "country_timezones", "NG"): "['Africa/Lagos']", + ("modules", "pytz", "country_timezones", "NI"): "['America/Managua']", + ("modules", "pytz", "country_timezones", "NL"): "['Europe/Amsterdam']", + ("modules", "pytz", "country_timezones", "NO"): "['Europe/Oslo']", + ("modules", "pytz", "country_timezones", "NP"): "['Asia/Kathmandu']", + ("modules", "pytz", "country_timezones", "NR"): "['Pacific/Nauru']", + ("modules", "pytz", "country_timezones", "NU"): "['Pacific/Niue']", + ("modules", "pytz", "country_timezones", "NZ"): "['Pacific/Auckland', 'Pacific/Chatham']", + ("modules", "pytz", "country_timezones", "OM"): "['Asia/Muscat']", + ("modules", "pytz", "country_timezones", "PA"): "['America/Panama']", + ("modules", "pytz", "country_timezones", "PE"): "['America/Lima']", + ( + "modules", + "pytz", + "country_timezones", + "PF", + ): "['Pacific/Tahiti', 'Pacific/Marquesas', 'Pacific/Gambier']", + ( + "modules", + "pytz", + "country_timezones", + "PG", + ): "['Pacific/Port_Moresby', 'Pacific/Bougainville']", + ("modules", "pytz", "country_timezones", "PH"): "['Asia/Manila']", + ("modules", "pytz", "country_timezones", "PK"): "['Asia/Karachi']", + ("modules", "pytz", "country_timezones", "PL"): "['Europe/Warsaw']", + ("modules", "pytz", "country_timezones", "PM"): "['America/Miquelon']", + ("modules", "pytz", "country_timezones", "PN"): "['Pacific/Pitcairn']", + ("modules", "pytz", "country_timezones", "PR"): "['America/Puerto_Rico']", + ("modules", "pytz", "country_timezones", "PS"): "['Asia/Gaza', 'Asia/Hebron']", + ( + "modules", + "pytz", + "country_timezones", + "PT", + ): "['Europe/Lisbon', 'Atlantic/Madeira', 'Atlantic/Azores']", + ("modules", "pytz", "country_timezones", "PW"): "['Pacific/Palau']", + ("modules", "pytz", "country_timezones", "PY"): "['America/Asuncion']", + ("modules", "pytz", "country_timezones", "QA"): "['Asia/Qatar']", + ("modules", "pytz", "country_timezones", "RE"): "['Indian/Reunion']", + ("modules", "pytz", "country_timezones", "RO"): "['Europe/Bucharest']", + ("modules", "pytz", "country_timezones", "RS"): "['Europe/Belgrade']", + ( + "modules", + "pytz", + "country_timezones", + "RU", + ): "['Europe/Kaliningrad', 'Europe/Moscow', 'Europe/Kirov', 'Europe/Volgograd', 'Europe/Astrakhan', 'Europe/Saratov', 'Europe/Ulyanovsk', 'Europe/Samara', 'Asia/Yekaterinburg', 'Asia/Omsk', 'Asia/Novosibirsk', 'Asia/Barnaul', 'Asia/Tomsk', 'Asia/Novokuznetsk', 'Asia/Krasnoyarsk', 'Asia/Irkutsk', 'Asia/Chita', 'Asia/Yakutsk', 'Asia/Khandyga', 'Asia/Vladivostok', 'Asia/Ust-Nera', 'Asia/Magadan', 'Asia/Sakhalin', 'Asia/Srednekolymsk', 'Asia/Kamchatka', 'Asia/Anadyr']", + ("modules", "pytz", "country_timezones", "UA"): "['Europe/Simferopol', 'Europe/Kyiv']", + ("modules", "pytz", "country_timezones", "RW"): "['Africa/Kigali']", + ("modules", "pytz", "country_timezones", "SA"): "['Asia/Riyadh']", + ("modules", "pytz", "country_timezones", "SB"): "['Pacific/Guadalcanal']", + ("modules", "pytz", "country_timezones", "SC"): "['Indian/Mahe']", + ("modules", "pytz", "country_timezones", "SD"): "['Africa/Khartoum']", + ("modules", "pytz", "country_timezones", "SE"): "['Europe/Stockholm']", + ("modules", "pytz", "country_timezones", "SG"): "['Asia/Singapore']", + ("modules", "pytz", "country_timezones", "SH"): "['Atlantic/St_Helena']", + ("modules", "pytz", "country_timezones", "SI"): "['Europe/Ljubljana']", + ("modules", "pytz", "country_timezones", "SJ"): "['Arctic/Longyearbyen']", + ("modules", "pytz", "country_timezones", "SK"): "['Europe/Bratislava']", + ("modules", "pytz", "country_timezones", "SL"): "['Africa/Freetown']", + ("modules", "pytz", "country_timezones", "SM"): "['Europe/San_Marino']", + ("modules", "pytz", "country_timezones", "SN"): "['Africa/Dakar']", + ("modules", "pytz", "country_timezones", "SO"): "['Africa/Mogadishu']", + ("modules", "pytz", "country_timezones", "SR"): "['America/Paramaribo']", + ("modules", "pytz", "country_timezones", "SS"): "['Africa/Juba']", + ("modules", "pytz", "country_timezones", "ST"): "['Africa/Sao_Tome']", + ("modules", "pytz", "country_timezones", "SV"): "['America/El_Salvador']", + ("modules", "pytz", "country_timezones", "SX"): "['America/Lower_Princes']", + ("modules", "pytz", "country_timezones", "SY"): "['Asia/Damascus']", + ("modules", "pytz", "country_timezones", "SZ"): "['Africa/Mbabane']", + ("modules", "pytz", "country_timezones", "TC"): "['America/Grand_Turk']", + ("modules", "pytz", "country_timezones", "TD"): "['Africa/Ndjamena']", + ("modules", "pytz", "country_timezones", "TF"): "['Indian/Kerguelen']", + ("modules", "pytz", "country_timezones", "TG"): "['Africa/Lome']", + ("modules", "pytz", "country_timezones", "TH"): "['Asia/Bangkok']", + ("modules", "pytz", "country_timezones", "TJ"): "['Asia/Dushanbe']", + ("modules", "pytz", "country_timezones", "TK"): "['Pacific/Fakaofo']", + ("modules", "pytz", "country_timezones", "TL"): "['Asia/Dili']", + ("modules", "pytz", "country_timezones", "TM"): "['Asia/Ashgabat']", + ("modules", "pytz", "country_timezones", "TN"): "['Africa/Tunis']", + ("modules", "pytz", "country_timezones", "TO"): "['Pacific/Tongatapu']", + ("modules", "pytz", "country_timezones", "TR"): "['Europe/Istanbul']", + ("modules", "pytz", "country_timezones", "TT"): "['America/Port_of_Spain']", + ("modules", "pytz", "country_timezones", "TV"): "['Pacific/Funafuti']", + ("modules", "pytz", "country_timezones", "TW"): "['Asia/Taipei']", + ("modules", "pytz", "country_timezones", "TZ"): "['Africa/Dar_es_Salaam']", + ("modules", "pytz", "country_timezones", "UG"): "['Africa/Kampala']", + ("modules", "pytz", "country_timezones", "UM"): "['Pacific/Midway', 'Pacific/Wake']", + ( + "modules", + "pytz", + "country_timezones", + "US", + ): "['America/New_York', 'America/Detroit', 'America/Kentucky/Louisville', 'America/Kentucky/Monticello', 'America/Indiana/Indianapolis', 'America/Indiana/Vincennes', 'America/Indiana/Winamac', 'America/Indiana/Marengo', 'America/Indiana/Petersburg', 'America/Indiana/Vevay', 'America/Chicago', 'America/Indiana/Tell_City', 'America/Indiana/Knox', 'America/Menominee', 'America/North_Dakota/Center', 'America/North_Dakota/New_Salem', 'America/North_Dakota/Beulah', 'America/Denver', 'America/Boise', 'America/Phoenix', 'America/Los_Angeles', 'America/Anchorage', 'America/Juneau', 'America/Sitka', 'America/Metlakatla', 'America/Yakutat', 'America/Nome', 'America/Adak', 'Pacific/Honolulu']", + ("modules", "pytz", "country_timezones", "UY"): "['America/Montevideo']", + ("modules", "pytz", "country_timezones", "UZ"): "['Asia/Samarkand', 'Asia/Tashkent']", + ("modules", "pytz", "country_timezones", "VA"): "['Europe/Vatican']", + ("modules", "pytz", "country_timezones", "VC"): "['America/St_Vincent']", + ("modules", "pytz", "country_timezones", "VE"): "['America/Caracas']", + ("modules", "pytz", "country_timezones", "VG"): "['America/Tortola']", + ("modules", "pytz", "country_timezones", "VI"): "['America/St_Thomas']", + ("modules", "pytz", "country_timezones", "VN"): "['Asia/Ho_Chi_Minh']", + ("modules", "pytz", "country_timezones", "VU"): "['Pacific/Efate']", + ("modules", "pytz", "country_timezones", "WF"): "['Pacific/Wallis']", + ("modules", "pytz", "country_timezones", "WS"): "['Pacific/Apia']", + ("modules", "pytz", "country_timezones", "YE"): "['Asia/Aden']", + ("modules", "pytz", "country_timezones", "YT"): "['Indian/Mayotte']", + ("modules", "pytz", "country_timezones", "ZA"): "['Africa/Johannesburg']", + ("modules", "pytz", "country_timezones", "ZM"): "['Africa/Lusaka']", + ("modules", "pytz", "country_timezones", "ZW"): "['Africa/Harare']", + ("modules", "pytz", "country_names", "AD"): "Andorra", + ("modules", "pytz", "country_names", "AE"): "United Arab Emirates", + ("modules", "pytz", "country_names", "AF"): "Afghanistan", + ("modules", "pytz", "country_names", "AG"): "Antigua & Barbuda", + ("modules", "pytz", "country_names", "AI"): "Anguilla", + ("modules", "pytz", "country_names", "AL"): "Albania", + ("modules", "pytz", "country_names", "AM"): "Armenia", + ("modules", "pytz", "country_names", "AO"): "Angola", + ("modules", "pytz", "country_names", "AQ"): "Antarctica", + ("modules", "pytz", "country_names", "AR"): "Argentina", + ("modules", "pytz", "country_names", "AS"): "Samoa (American)", + ("modules", "pytz", "country_names", "AT"): "Austria", + ("modules", "pytz", "country_names", "AU"): "Australia", + ("modules", "pytz", "country_names", "AW"): "Aruba", + ("modules", "pytz", "country_names", "AX"): "Åland Islands", + ("modules", "pytz", "country_names", "AZ"): "Azerbaijan", + ("modules", "pytz", "country_names", "BA"): "Bosnia & Herzegovina", + ("modules", "pytz", "country_names", "BB"): "Barbados", + ("modules", "pytz", "country_names", "BD"): "Bangladesh", + ("modules", "pytz", "country_names", "BE"): "Belgium", + ("modules", "pytz", "country_names", "BF"): "Burkina Faso", + ("modules", "pytz", "country_names", "BG"): "Bulgaria", + ("modules", "pytz", "country_names", "BH"): "Bahrain", + ("modules", "pytz", "country_names", "BI"): "Burundi", + ("modules", "pytz", "country_names", "BJ"): "Benin", + ("modules", "pytz", "country_names", "BL"): "St Barthelemy", + ("modules", "pytz", "country_names", "BM"): "Bermuda", + ("modules", "pytz", "country_names", "BN"): "Brunei", + ("modules", "pytz", "country_names", "BO"): "Bolivia", + ("modules", "pytz", "country_names", "BQ"): "Caribbean NL", + ("modules", "pytz", "country_names", "BR"): "Brazil", + ("modules", "pytz", "country_names", "BS"): "Bahamas", + ("modules", "pytz", "country_names", "BT"): "Bhutan", + ("modules", "pytz", "country_names", "BV"): "Bouvet Island", + ("modules", "pytz", "country_names", "BW"): "Botswana", + ("modules", "pytz", "country_names", "BY"): "Belarus", + ("modules", "pytz", "country_names", "BZ"): "Belize", + ("modules", "pytz", "country_names", "CA"): "Canada", + ("modules", "pytz", "country_names", "CC"): "Cocos (Keeling) Islands", + ("modules", "pytz", "country_names", "CD"): "Congo (Dem. Rep.)", + ("modules", "pytz", "country_names", "CF"): "Central African Rep.", + ("modules", "pytz", "country_names", "CG"): "Congo (Rep.)", + ("modules", "pytz", "country_names", "CH"): "Switzerland", + ("modules", "pytz", "country_names", "CI"): "Côte d'Ivoire", + ("modules", "pytz", "country_names", "CK"): "Cook Islands", + ("modules", "pytz", "country_names", "CL"): "Chile", + ("modules", "pytz", "country_names", "CM"): "Cameroon", + ("modules", "pytz", "country_names", "CN"): "China", + ("modules", "pytz", "country_names", "CO"): "Colombia", + ("modules", "pytz", "country_names", "CR"): "Costa Rica", + ("modules", "pytz", "country_names", "CU"): "Cuba", + ("modules", "pytz", "country_names", "CV"): "Cape Verde", + ("modules", "pytz", "country_names", "CW"): "Curaçao", + ("modules", "pytz", "country_names", "CX"): "Christmas Island", + ("modules", "pytz", "country_names", "CY"): "Cyprus", + ("modules", "pytz", "country_names", "CZ"): "Czech Republic", + ("modules", "pytz", "country_names", "DE"): "Germany", + ("modules", "pytz", "country_names", "DJ"): "Djibouti", + ("modules", "pytz", "country_names", "DK"): "Denmark", + ("modules", "pytz", "country_names", "DM"): "Dominica", + ("modules", "pytz", "country_names", "DO"): "Dominican Republic", + ("modules", "pytz", "country_names", "DZ"): "Algeria", + ("modules", "pytz", "country_names", "EC"): "Ecuador", + ("modules", "pytz", "country_names", "EE"): "Estonia", + ("modules", "pytz", "country_names", "EG"): "Egypt", + ("modules", "pytz", "country_names", "EH"): "Western Sahara", + ("modules", "pytz", "country_names", "ER"): "Eritrea", + ("modules", "pytz", "country_names", "ES"): "Spain", + ("modules", "pytz", "country_names", "ET"): "Ethiopia", + ("modules", "pytz", "country_names", "FI"): "Finland", + ("modules", "pytz", "country_names", "FJ"): "Fiji", + ("modules", "pytz", "country_names", "FK"): "Falkland Islands", + ("modules", "pytz", "country_names", "FM"): "Micronesia", + ("modules", "pytz", "country_names", "FO"): "Faroe Islands", + ("modules", "pytz", "country_names", "FR"): "France", + ("modules", "pytz", "country_names", "GA"): "Gabon", + ("modules", "pytz", "country_names", "GB"): "Britain (UK)", + ("modules", "pytz", "country_names", "GD"): "Grenada", + ("modules", "pytz", "country_names", "GE"): "Georgia", + ("modules", "pytz", "country_names", "GF"): "French Guiana", + ("modules", "pytz", "country_names", "GG"): "Guernsey", + ("modules", "pytz", "country_names", "GH"): "Ghana", + ("modules", "pytz", "country_names", "GI"): "Gibraltar", + ("modules", "pytz", "country_names", "GL"): "Greenland", + ("modules", "pytz", "country_names", "GM"): "Gambia", + ("modules", "pytz", "country_names", "GN"): "Guinea", + ("modules", "pytz", "country_names", "GP"): "Guadeloupe", + ("modules", "pytz", "country_names", "GQ"): "Equatorial Guinea", + ("modules", "pytz", "country_names", "GR"): "Greece", + ("modules", "pytz", "country_names", "GS"): "South Georgia & the South Sandwich Islands", + ("modules", "pytz", "country_names", "GT"): "Guatemala", + ("modules", "pytz", "country_names", "GU"): "Guam", + ("modules", "pytz", "country_names", "GW"): "Guinea-Bissau", + ("modules", "pytz", "country_names", "GY"): "Guyana", + ("modules", "pytz", "country_names", "HK"): "Hong Kong", + ("modules", "pytz", "country_names", "HM"): "Heard Island & McDonald Islands", + ("modules", "pytz", "country_names", "HN"): "Honduras", + ("modules", "pytz", "country_names", "HR"): "Croatia", + ("modules", "pytz", "country_names", "HT"): "Haiti", + ("modules", "pytz", "country_names", "HU"): "Hungary", + ("modules", "pytz", "country_names", "ID"): "Indonesia", + ("modules", "pytz", "country_names", "IE"): "Ireland", + ("modules", "pytz", "country_names", "IL"): "Israel", + ("modules", "pytz", "country_names", "IM"): "Isle of Man", + ("modules", "pytz", "country_names", "IN"): "India", + ("modules", "pytz", "country_names", "IO"): "British Indian Ocean Territory", + ("modules", "pytz", "country_names", "IQ"): "Iraq", + ("modules", "pytz", "country_names", "IR"): "Iran", + ("modules", "pytz", "country_names", "IS"): "Iceland", + ("modules", "pytz", "country_names", "IT"): "Italy", + ("modules", "pytz", "country_names", "JE"): "Jersey", + ("modules", "pytz", "country_names", "JM"): "Jamaica", + ("modules", "pytz", "country_names", "JO"): "Jordan", + ("modules", "pytz", "country_names", "JP"): "Japan", + ("modules", "pytz", "country_names", "KE"): "Kenya", + ("modules", "pytz", "country_names", "KG"): "Kyrgyzstan", + ("modules", "pytz", "country_names", "KH"): "Cambodia", + ("modules", "pytz", "country_names", "KI"): "Kiribati", + ("modules", "pytz", "country_names", "KM"): "Comoros", + ("modules", "pytz", "country_names", "KN"): "St Kitts & Nevis", + ("modules", "pytz", "country_names", "KP"): "Korea (North)", + ("modules", "pytz", "country_names", "KR"): "Korea (South)", + ("modules", "pytz", "country_names", "KW"): "Kuwait", + ("modules", "pytz", "country_names", "KY"): "Cayman Islands", + ("modules", "pytz", "country_names", "KZ"): "Kazakhstan", + ("modules", "pytz", "country_names", "LA"): "Laos", + ("modules", "pytz", "country_names", "LB"): "Lebanon", + ("modules", "pytz", "country_names", "LC"): "St Lucia", + ("modules", "pytz", "country_names", "LI"): "Liechtenstein", + ("modules", "pytz", "country_names", "LK"): "Sri Lanka", + ("modules", "pytz", "country_names", "LR"): "Liberia", + ("modules", "pytz", "country_names", "LS"): "Lesotho", + ("modules", "pytz", "country_names", "LT"): "Lithuania", + ("modules", "pytz", "country_names", "LU"): "Luxembourg", + ("modules", "pytz", "country_names", "LV"): "Latvia", + ("modules", "pytz", "country_names", "LY"): "Libya", + ("modules", "pytz", "country_names", "MA"): "Morocco", + ("modules", "pytz", "country_names", "MC"): "Monaco", + ("modules", "pytz", "country_names", "MD"): "Moldova", + ("modules", "pytz", "country_names", "ME"): "Montenegro", + ("modules", "pytz", "country_names", "MF"): "St Martin (French)", + ("modules", "pytz", "country_names", "MG"): "Madagascar", + ("modules", "pytz", "country_names", "MH"): "Marshall Islands", + ("modules", "pytz", "country_names", "MK"): "North Macedonia", + ("modules", "pytz", "country_names", "ML"): "Mali", + ("modules", "pytz", "country_names", "MM"): "Myanmar (Burma)", + ("modules", "pytz", "country_names", "MN"): "Mongolia", + ("modules", "pytz", "country_names", "MO"): "Macau", + ("modules", "pytz", "country_names", "MP"): "Northern Mariana Islands", + ("modules", "pytz", "country_names", "MQ"): "Martinique", + ("modules", "pytz", "country_names", "MR"): "Mauritania", + ("modules", "pytz", "country_names", "MS"): "Montserrat", + ("modules", "pytz", "country_names", "MT"): "Malta", + ("modules", "pytz", "country_names", "MU"): "Mauritius", + ("modules", "pytz", "country_names", "MV"): "Maldives", + ("modules", "pytz", "country_names", "MW"): "Malawi", + ("modules", "pytz", "country_names", "MX"): "Mexico", + ("modules", "pytz", "country_names", "MY"): "Malaysia", + ("modules", "pytz", "country_names", "MZ"): "Mozambique", + ("modules", "pytz", "country_names", "NA"): "Namibia", + ("modules", "pytz", "country_names", "NC"): "New Caledonia", + ("modules", "pytz", "country_names", "NE"): "Niger", + ("modules", "pytz", "country_names", "NF"): "Norfolk Island", + ("modules", "pytz", "country_names", "NG"): "Nigeria", + ("modules", "pytz", "country_names", "NI"): "Nicaragua", + ("modules", "pytz", "country_names", "NL"): "Netherlands", + ("modules", "pytz", "country_names", "NO"): "Norway", + ("modules", "pytz", "country_names", "NP"): "Nepal", + ("modules", "pytz", "country_names", "NR"): "Nauru", + ("modules", "pytz", "country_names", "NU"): "Niue", + ("modules", "pytz", "country_names", "NZ"): "New Zealand", + ("modules", "pytz", "country_names", "OM"): "Oman", + ("modules", "pytz", "country_names", "PA"): "Panama", + ("modules", "pytz", "country_names", "PE"): "Peru", + ("modules", "pytz", "country_names", "PF"): "French Polynesia", + ("modules", "pytz", "country_names", "PG"): "Papua New Guinea", + ("modules", "pytz", "country_names", "PH"): "Philippines", + ("modules", "pytz", "country_names", "PK"): "Pakistan", + ("modules", "pytz", "country_names", "PL"): "Poland", + ("modules", "pytz", "country_names", "PM"): "St Pierre & Miquelon", + ("modules", "pytz", "country_names", "PN"): "Pitcairn", + ("modules", "pytz", "country_names", "PR"): "Puerto Rico", + ("modules", "pytz", "country_names", "PS"): "Palestine", + ("modules", "pytz", "country_names", "PT"): "Portugal", + ("modules", "pytz", "country_names", "PW"): "Palau", + ("modules", "pytz", "country_names", "PY"): "Paraguay", + ("modules", "pytz", "country_names", "QA"): "Qatar", + ("modules", "pytz", "country_names", "RE"): "Réunion", + ("modules", "pytz", "country_names", "RO"): "Romania", + ("modules", "pytz", "country_names", "RS"): "Serbia", + ("modules", "pytz", "country_names", "RU"): "Russia", + ("modules", "pytz", "country_names", "RW"): "Rwanda", + ("modules", "pytz", "country_names", "SA"): "Saudi Arabia", + ("modules", "pytz", "country_names", "SB"): "Solomon Islands", + ("modules", "pytz", "country_names", "SC"): "Seychelles", + ("modules", "pytz", "country_names", "SD"): "Sudan", + ("modules", "pytz", "country_names", "SE"): "Sweden", + ("modules", "pytz", "country_names", "SG"): "Singapore", + ("modules", "pytz", "country_names", "SH"): "St Helena", + ("modules", "pytz", "country_names", "SI"): "Slovenia", + ("modules", "pytz", "country_names", "SJ"): "Svalbard & Jan Mayen", + ("modules", "pytz", "country_names", "SK"): "Slovakia", + ("modules", "pytz", "country_names", "SL"): "Sierra Leone", + ("modules", "pytz", "country_names", "SM"): "San Marino", + ("modules", "pytz", "country_names", "SN"): "Senegal", + ("modules", "pytz", "country_names", "SO"): "Somalia", + ("modules", "pytz", "country_names", "SR"): "Suriname", + ("modules", "pytz", "country_names", "SS"): "South Sudan", + ("modules", "pytz", "country_names", "ST"): "Sao Tome & Principe", + ("modules", "pytz", "country_names", "SV"): "El Salvador", + ("modules", "pytz", "country_names", "SX"): "St Maarten (Dutch)", + ("modules", "pytz", "country_names", "SY"): "Syria", + ("modules", "pytz", "country_names", "SZ"): "Eswatini (Swaziland)", + ("modules", "pytz", "country_names", "TC"): "Turks & Caicos Is", + ("modules", "pytz", "country_names", "TD"): "Chad", + ("modules", "pytz", "country_names", "TF"): "French S. Terr.", + ("modules", "pytz", "country_names", "TG"): "Togo", + ("modules", "pytz", "country_names", "TH"): "Thailand", + ("modules", "pytz", "country_names", "TJ"): "Tajikistan", + ("modules", "pytz", "country_names", "TK"): "Tokelau", + ("modules", "pytz", "country_names", "TL"): "East Timor", + ("modules", "pytz", "country_names", "TM"): "Turkmenistan", + ("modules", "pytz", "country_names", "TN"): "Tunisia", + ("modules", "pytz", "country_names", "TO"): "Tonga", + ("modules", "pytz", "country_names", "TR"): "Turkey", + ("modules", "pytz", "country_names", "TT"): "Trinidad & Tobago", + ("modules", "pytz", "country_names", "TV"): "Tuvalu", + ("modules", "pytz", "country_names", "TW"): "Taiwan", + ("modules", "pytz", "country_names", "TZ"): "Tanzania", + ("modules", "pytz", "country_names", "UA"): "Ukraine", + ("modules", "pytz", "country_names", "UG"): "Uganda", + ("modules", "pytz", "country_names", "UM"): "US minor outlying islands", + ("modules", "pytz", "country_names", "US"): "United States", + ("modules", "pytz", "country_names", "UY"): "Uruguay", + ("modules", "pytz", "country_names", "UZ"): "Uzbekistan", + ("modules", "pytz", "country_names", "VA"): "Vatican City", + ("modules", "pytz", "country_names", "VC"): "St Vincent", + ("modules", "pytz", "country_names", "VE"): "Venezuela", + ("modules", "pytz", "country_names", "VG"): "Virgin Islands (UK)", + ("modules", "pytz", "country_names", "VI"): "Virgin Islands (US)", + ("modules", "pytz", "country_names", "VN"): "Vietnam", + ("modules", "pytz", "country_names", "VU"): "Vanuatu", + ("modules", "pytz", "country_names", "WF"): "Wallis & Futuna", + ("modules", "pytz", "country_names", "WS"): "Samoa (western)", + ("modules", "pytz", "country_names", "YE"): "Yemen", + ("modules", "pytz", "country_names", "YT"): "Mayotte", + ("modules", "pytz", "country_names", "ZA"): "South Africa", + ("modules", "pytz", "country_names", "ZM"): "Zambia", + ("modules", "pytz", "country_names", "ZW"): "Zimbabwe", +} + def model(): return ModelNode( @@ -478,13 +2033,56 @@ def test_model_parse_context(config_postgres, manifest_fx, get_adapter, get_incl assert_has_keys(REQUIRED_MODEL_KEYS, MAYBE_KEYS, ctx) +def walk_dict(dictionary): + skip_paths = [ + ["invocation_id"], + ["builtins", "invocation_id"], + ["dbt_version"], + ["builtins", "dbt_version"], + ] + + stack = [(dictionary, [])] + visited = set() # Set to keep track of visited dictionary objects + + def clean_value(value): + if isinstance(value, set): + return set(value) + elif isinstance(value, Namespace): + return value.__dict__ + elif isinstance(value, Var): + return {k: v for k, v in value._merged.items()} + else: + value_str = str(value) + value_str = re.sub(r" at 0x[0-9a-fA-F]+>", ">", value_str) + value_str = re.sub(r" id='[0-9]+'>", ">", value_str) + return value_str + + while stack: + current_dict, path = stack.pop(0) + + if id(current_dict) in visited: + continue + + visited.add(id(current_dict)) + + for key, value in current_dict.items(): + current_path = path + [key] + + if isinstance(value, Mapping): + stack.append((value, current_path)) + else: + if current_path not in skip_paths: + yield (tuple(current_path), clean_value(value)) + + def test_model_runtime_context(config_postgres, manifest_fx, get_adapter, get_include_paths): ctx = providers.generate_runtime_model_context( model=mock_model(), config=config_postgres, manifest=manifest_fx, ) - assert_has_keys(REQUIRED_MODEL_KEYS, MAYBE_KEYS, ctx) + actual_model_context = {k: v for (k, v) in walk_dict(ctx)} + assert actual_model_context == EXPECTED_MODEL_CONTEXT def test_docs_runtime_context(config_postgres): From 61184aa931302fbd2cae921a3b1847c1f3fadc9b Mon Sep 17 00:00:00 2001 From: Kshitij Aranke Date: Mon, 9 Sep 2024 14:59:52 +0100 Subject: [PATCH 02/19] simplify pytz pt1 --- tests/unit/context/test_context.py | 611 +---------------------------- 1 file changed, 3 insertions(+), 608 deletions(-) diff --git a/tests/unit/context/test_context.py b/tests/unit/context/test_context.py index cc4e41d1062..600648f3710 100644 --- a/tests/unit/context/test_context.py +++ b/tests/unit/context/test_context.py @@ -571,614 +571,9 @@ def assert_has_keys(required_keys: Set[str], maybe_keys: Set[str], ctx: Dict[str ("modules", "pytz", "InvalidTimeError"): "", ("modules", "pytz", "NonExistentTimeError"): "", ("modules", "pytz", "UnknownTimeZoneError"): "", - ( - "modules", - "pytz", - "all_timezones", - ): "['Africa/Abidjan', 'Africa/Accra', 'Africa/Addis_Ababa', 'Africa/Algiers', 'Africa/Asmara', 'Africa/Asmera', 'Africa/Bamako', 'Africa/Bangui', 'Africa/Banjul', 'Africa/Bissau', 'Africa/Blantyre', 'Africa/Brazzaville', 'Africa/Bujumbura', 'Africa/Cairo', 'Africa/Casablanca', 'Africa/Ceuta', 'Africa/Conakry', 'Africa/Dakar', 'Africa/Dar_es_Salaam', 'Africa/Djibouti', 'Africa/Douala', 'Africa/El_Aaiun', 'Africa/Freetown', 'Africa/Gaborone', 'Africa/Harare', 'Africa/Johannesburg', 'Africa/Juba', 'Africa/Kampala', 'Africa/Khartoum', 'Africa/Kigali', 'Africa/Kinshasa', 'Africa/Lagos', 'Africa/Libreville', 'Africa/Lome', 'Africa/Luanda', 'Africa/Lubumbashi', 'Africa/Lusaka', 'Africa/Malabo', 'Africa/Maputo', 'Africa/Maseru', 'Africa/Mbabane', 'Africa/Mogadishu', 'Africa/Monrovia', 'Africa/Nairobi', 'Africa/Ndjamena', 'Africa/Niamey', 'Africa/Nouakchott', 'Africa/Ouagadougou', 'Africa/Porto-Novo', 'Africa/Sao_Tome', 'Africa/Timbuktu', 'Africa/Tripoli', 'Africa/Tunis', 'Africa/Windhoek', 'America/Adak', 'America/Anchorage', 'America/Anguilla', 'America/Antigua', 'America/Araguaina', 'America/Argentina/Buenos_Aires', 'America/Argentina/Catamarca', 'America/Argentina/ComodRivadavia', 'America/Argentina/Cordoba', 'America/Argentina/Jujuy', 'America/Argentina/La_Rioja', 'America/Argentina/Mendoza', 'America/Argentina/Rio_Gallegos', 'America/Argentina/Salta', 'America/Argentina/San_Juan', 'America/Argentina/San_Luis', 'America/Argentina/Tucuman', 'America/Argentina/Ushuaia', 'America/Aruba', 'America/Asuncion', 'America/Atikokan', 'America/Atka', 'America/Bahia', 'America/Bahia_Banderas', 'America/Barbados', 'America/Belem', 'America/Belize', 'America/Blanc-Sablon', 'America/Boa_Vista', 'America/Bogota', 'America/Boise', 'America/Buenos_Aires', 'America/Cambridge_Bay', 'America/Campo_Grande', 'America/Cancun', 'America/Caracas', 'America/Catamarca', 'America/Cayenne', 'America/Cayman', 'America/Chicago', 'America/Chihuahua', 'America/Ciudad_Juarez', 'America/Coral_Harbour', 'America/Cordoba', 'America/Costa_Rica', 'America/Creston', 'America/Cuiaba', 'America/Curacao', 'America/Danmarkshavn', 'America/Dawson', 'America/Dawson_Creek', 'America/Denver', 'America/Detroit', 'America/Dominica', 'America/Edmonton', 'America/Eirunepe', 'America/El_Salvador', 'America/Ensenada', 'America/Fort_Nelson', 'America/Fort_Wayne', 'America/Fortaleza', 'America/Glace_Bay', 'America/Godthab', 'America/Goose_Bay', 'America/Grand_Turk', 'America/Grenada', 'America/Guadeloupe', 'America/Guatemala', 'America/Guayaquil', 'America/Guyana', 'America/Halifax', 'America/Havana', 'America/Hermosillo', 'America/Indiana/Indianapolis', 'America/Indiana/Knox', 'America/Indiana/Marengo', 'America/Indiana/Petersburg', 'America/Indiana/Tell_City', 'America/Indiana/Vevay', 'America/Indiana/Vincennes', 'America/Indiana/Winamac', 'America/Indianapolis', 'America/Inuvik', 'America/Iqaluit', 'America/Jamaica', 'America/Jujuy', 'America/Juneau', 'America/Kentucky/Louisville', 'America/Kentucky/Monticello', 'America/Knox_IN', 'America/Kralendijk', 'America/La_Paz', 'America/Lima', 'America/Los_Angeles', 'America/Louisville', 'America/Lower_Princes', 'America/Maceio', 'America/Managua', 'America/Manaus', 'America/Marigot', 'America/Martinique', 'America/Matamoros', 'America/Mazatlan', 'America/Mendoza', 'America/Menominee', 'America/Merida', 'America/Metlakatla', 'America/Mexico_City', 'America/Miquelon', 'America/Moncton', 'America/Monterrey', 'America/Montevideo', 'America/Montreal', 'America/Montserrat', 'America/Nassau', 'America/New_York', 'America/Nipigon', 'America/Nome', 'America/Noronha', 'America/North_Dakota/Beulah', 'America/North_Dakota/Center', 'America/North_Dakota/New_Salem', 'America/Nuuk', 'America/Ojinaga', 'America/Panama', 'America/Pangnirtung', 'America/Paramaribo', 'America/Phoenix', 'America/Port-au-Prince', 'America/Port_of_Spain', 'America/Porto_Acre', 'America/Porto_Velho', 'America/Puerto_Rico', 'America/Punta_Arenas', 'America/Rainy_River', 'America/Rankin_Inlet', 'America/Recife', 'America/Regina', 'America/Resolute', 'America/Rio_Branco', 'America/Rosario', 'America/Santa_Isabel', 'America/Santarem', 'America/Santiago', 'America/Santo_Domingo', 'America/Sao_Paulo', 'America/Scoresbysund', 'America/Shiprock', 'America/Sitka', 'America/St_Barthelemy', 'America/St_Johns', 'America/St_Kitts', 'America/St_Lucia', 'America/St_Thomas', 'America/St_Vincent', 'America/Swift_Current', 'America/Tegucigalpa', 'America/Thule', 'America/Thunder_Bay', 'America/Tijuana', 'America/Toronto', 'America/Tortola', 'America/Vancouver', 'America/Virgin', 'America/Whitehorse', 'America/Winnipeg', 'America/Yakutat', 'America/Yellowknife', 'Antarctica/Casey', 'Antarctica/Davis', 'Antarctica/DumontDUrville', 'Antarctica/Macquarie', 'Antarctica/Mawson', 'Antarctica/McMurdo', 'Antarctica/Palmer', 'Antarctica/Rothera', 'Antarctica/South_Pole', 'Antarctica/Syowa', 'Antarctica/Troll', 'Antarctica/Vostok', 'Arctic/Longyearbyen', 'Asia/Aden', 'Asia/Almaty', 'Asia/Amman', 'Asia/Anadyr', 'Asia/Aqtau', 'Asia/Aqtobe', 'Asia/Ashgabat', 'Asia/Ashkhabad', 'Asia/Atyrau', 'Asia/Baghdad', 'Asia/Bahrain', 'Asia/Baku', 'Asia/Bangkok', 'Asia/Barnaul', 'Asia/Beirut', 'Asia/Bishkek', 'Asia/Brunei', 'Asia/Calcutta', 'Asia/Chita', 'Asia/Choibalsan', 'Asia/Chongqing', 'Asia/Chungking', 'Asia/Colombo', 'Asia/Dacca', 'Asia/Damascus', 'Asia/Dhaka', 'Asia/Dili', 'Asia/Dubai', 'Asia/Dushanbe', 'Asia/Famagusta', 'Asia/Gaza', 'Asia/Harbin', 'Asia/Hebron', 'Asia/Ho_Chi_Minh', 'Asia/Hong_Kong', 'Asia/Hovd', 'Asia/Irkutsk', 'Asia/Istanbul', 'Asia/Jakarta', 'Asia/Jayapura', 'Asia/Jerusalem', 'Asia/Kabul', 'Asia/Kamchatka', 'Asia/Karachi', 'Asia/Kashgar', 'Asia/Kathmandu', 'Asia/Katmandu', 'Asia/Khandyga', 'Asia/Kolkata', 'Asia/Krasnoyarsk', 'Asia/Kuala_Lumpur', 'Asia/Kuching', 'Asia/Kuwait', 'Asia/Macao', 'Asia/Macau', 'Asia/Magadan', 'Asia/Makassar', 'Asia/Manila', 'Asia/Muscat', 'Asia/Nicosia', 'Asia/Novokuznetsk', 'Asia/Novosibirsk', 'Asia/Omsk', 'Asia/Oral', 'Asia/Phnom_Penh', 'Asia/Pontianak', 'Asia/Pyongyang', 'Asia/Qatar', 'Asia/Qostanay', 'Asia/Qyzylorda', 'Asia/Rangoon', 'Asia/Riyadh', 'Asia/Saigon', 'Asia/Sakhalin', 'Asia/Samarkand', 'Asia/Seoul', 'Asia/Shanghai', 'Asia/Singapore', 'Asia/Srednekolymsk', 'Asia/Taipei', 'Asia/Tashkent', 'Asia/Tbilisi', 'Asia/Tehran', 'Asia/Tel_Aviv', 'Asia/Thimbu', 'Asia/Thimphu', 'Asia/Tokyo', 'Asia/Tomsk', 'Asia/Ujung_Pandang', 'Asia/Ulaanbaatar', 'Asia/Ulan_Bator', 'Asia/Urumqi', 'Asia/Ust-Nera', 'Asia/Vientiane', 'Asia/Vladivostok', 'Asia/Yakutsk', 'Asia/Yangon', 'Asia/Yekaterinburg', 'Asia/Yerevan', 'Atlantic/Azores', 'Atlantic/Bermuda', 'Atlantic/Canary', 'Atlantic/Cape_Verde', 'Atlantic/Faeroe', 'Atlantic/Faroe', 'Atlantic/Jan_Mayen', 'Atlantic/Madeira', 'Atlantic/Reykjavik', 'Atlantic/South_Georgia', 'Atlantic/St_Helena', 'Atlantic/Stanley', 'Australia/ACT', 'Australia/Adelaide', 'Australia/Brisbane', 'Australia/Broken_Hill', 'Australia/Canberra', 'Australia/Currie', 'Australia/Darwin', 'Australia/Eucla', 'Australia/Hobart', 'Australia/LHI', 'Australia/Lindeman', 'Australia/Lord_Howe', 'Australia/Melbourne', 'Australia/NSW', 'Australia/North', 'Australia/Perth', 'Australia/Queensland', 'Australia/South', 'Australia/Sydney', 'Australia/Tasmania', 'Australia/Victoria', 'Australia/West', 'Australia/Yancowinna', 'Brazil/Acre', 'Brazil/DeNoronha', 'Brazil/East', 'Brazil/West', 'CET', 'CST6CDT', 'Canada/Atlantic', 'Canada/Central', 'Canada/Eastern', 'Canada/Mountain', 'Canada/Newfoundland', 'Canada/Pacific', 'Canada/Saskatchewan', 'Canada/Yukon', 'Chile/Continental', 'Chile/EasterIsland', 'Cuba', 'EET', 'EST', 'EST5EDT', 'Egypt', 'Eire', 'Etc/GMT', 'Etc/GMT+0', 'Etc/GMT+1', 'Etc/GMT+10', 'Etc/GMT+11', 'Etc/GMT+12', 'Etc/GMT+2', 'Etc/GMT+3', 'Etc/GMT+4', 'Etc/GMT+5', 'Etc/GMT+6', 'Etc/GMT+7', 'Etc/GMT+8', 'Etc/GMT+9', 'Etc/GMT-0', 'Etc/GMT-1', 'Etc/GMT-10', 'Etc/GMT-11', 'Etc/GMT-12', 'Etc/GMT-13', 'Etc/GMT-14', 'Etc/GMT-2', 'Etc/GMT-3', 'Etc/GMT-4', 'Etc/GMT-5', 'Etc/GMT-6', 'Etc/GMT-7', 'Etc/GMT-8', 'Etc/GMT-9', 'Etc/GMT0', 'Etc/Greenwich', 'Etc/UCT', 'Etc/UTC', 'Etc/Universal', 'Etc/Zulu', 'Europe/Amsterdam', 'Europe/Andorra', 'Europe/Astrakhan', 'Europe/Athens', 'Europe/Belfast', 'Europe/Belgrade', 'Europe/Berlin', 'Europe/Bratislava', 'Europe/Brussels', 'Europe/Bucharest', 'Europe/Budapest', 'Europe/Busingen', 'Europe/Chisinau', 'Europe/Copenhagen', 'Europe/Dublin', 'Europe/Gibraltar', 'Europe/Guernsey', 'Europe/Helsinki', 'Europe/Isle_of_Man', 'Europe/Istanbul', 'Europe/Jersey', 'Europe/Kaliningrad', 'Europe/Kiev', 'Europe/Kirov', 'Europe/Kyiv', 'Europe/Lisbon', 'Europe/Ljubljana', 'Europe/London', 'Europe/Luxembourg', 'Europe/Madrid', 'Europe/Malta', 'Europe/Mariehamn', 'Europe/Minsk', 'Europe/Monaco', 'Europe/Moscow', 'Europe/Nicosia', 'Europe/Oslo', 'Europe/Paris', 'Europe/Podgorica', 'Europe/Prague', 'Europe/Riga', 'Europe/Rome', 'Europe/Samara', 'Europe/San_Marino', 'Europe/Sarajevo', 'Europe/Saratov', 'Europe/Simferopol', 'Europe/Skopje', 'Europe/Sofia', 'Europe/Stockholm', 'Europe/Tallinn', 'Europe/Tirane', 'Europe/Tiraspol', 'Europe/Ulyanovsk', 'Europe/Uzhgorod', 'Europe/Vaduz', 'Europe/Vatican', 'Europe/Vienna', 'Europe/Vilnius', 'Europe/Volgograd', 'Europe/Warsaw', 'Europe/Zagreb', 'Europe/Zaporozhye', 'Europe/Zurich', 'GB', 'GB-Eire', 'GMT', 'GMT+0', 'GMT-0', 'GMT0', 'Greenwich', 'HST', 'Hongkong', 'Iceland', 'Indian/Antananarivo', 'Indian/Chagos', 'Indian/Christmas', 'Indian/Cocos', 'Indian/Comoro', 'Indian/Kerguelen', 'Indian/Mahe', 'Indian/Maldives', 'Indian/Mauritius', 'Indian/Mayotte', 'Indian/Reunion', 'Iran', 'Israel', 'Jamaica', 'Japan', 'Kwajalein', 'Libya', 'MET', 'MST', 'MST7MDT', 'Mexico/BajaNorte', 'Mexico/BajaSur', 'Mexico/General', 'NZ', 'NZ-CHAT', 'Navajo', 'PRC', 'PST8PDT', 'Pacific/Apia', 'Pacific/Auckland', 'Pacific/Bougainville', 'Pacific/Chatham', 'Pacific/Chuuk', 'Pacific/Easter', 'Pacific/Efate', 'Pacific/Enderbury', 'Pacific/Fakaofo', 'Pacific/Fiji', 'Pacific/Funafuti', 'Pacific/Galapagos', 'Pacific/Gambier', 'Pacific/Guadalcanal', 'Pacific/Guam', 'Pacific/Honolulu', 'Pacific/Johnston', 'Pacific/Kanton', 'Pacific/Kiritimati', 'Pacific/Kosrae', 'Pacific/Kwajalein', 'Pacific/Majuro', 'Pacific/Marquesas', 'Pacific/Midway', 'Pacific/Nauru', 'Pacific/Niue', 'Pacific/Norfolk', 'Pacific/Noumea', 'Pacific/Pago_Pago', 'Pacific/Palau', 'Pacific/Pitcairn', 'Pacific/Pohnpei', 'Pacific/Ponape', 'Pacific/Port_Moresby', 'Pacific/Rarotonga', 'Pacific/Saipan', 'Pacific/Samoa', 'Pacific/Tahiti', 'Pacific/Tarawa', 'Pacific/Tongatapu', 'Pacific/Truk', 'Pacific/Wake', 'Pacific/Wallis', 'Pacific/Yap', 'Poland', 'Portugal', 'ROC', 'ROK', 'Singapore', 'Turkey', 'UCT', 'US/Alaska', 'US/Aleutian', 'US/Arizona', 'US/Central', 'US/East-Indiana', 'US/Eastern', 'US/Hawaii', 'US/Indiana-Starke', 'US/Michigan', 'US/Mountain', 'US/Pacific', 'US/Samoa', 'UTC', 'Universal', 'W-SU', 'WET', 'Zulu']", - ("modules", "pytz", "all_timezones_set"): { - "Africa/Abidjan", - "Africa/Accra", - "Africa/Addis_Ababa", - "Africa/Algiers", - "Africa/Asmara", - "Africa/Asmera", - "Africa/Bamako", - "Africa/Bangui", - "Africa/Banjul", - "Africa/Bissau", - "Africa/Blantyre", - "Africa/Brazzaville", - "Africa/Bujumbura", - "Africa/Cairo", - "Africa/Casablanca", - "Africa/Ceuta", - "Africa/Conakry", - "Africa/Dakar", - "Africa/Dar_es_Salaam", - "Africa/Djibouti", - "Africa/Douala", - "Africa/El_Aaiun", - "Africa/Freetown", - "Africa/Gaborone", - "Africa/Harare", - "Africa/Johannesburg", - "Africa/Juba", - "Africa/Kampala", - "Africa/Khartoum", - "Africa/Kigali", - "Africa/Kinshasa", - "Africa/Lagos", - "Africa/Libreville", - "Africa/Lome", - "Africa/Luanda", - "Africa/Lubumbashi", - "Africa/Lusaka", - "Africa/Malabo", - "Africa/Maputo", - "Africa/Maseru", - "Africa/Mbabane", - "Africa/Mogadishu", - "Africa/Monrovia", - "Africa/Nairobi", - "Africa/Ndjamena", - "Africa/Niamey", - "Africa/Nouakchott", - "Africa/Ouagadougou", - "Africa/Porto-Novo", - "Africa/Sao_Tome", - "Africa/Timbuktu", - "Africa/Tripoli", - "Africa/Tunis", - "Africa/Windhoek", - "America/Adak", - "America/Anchorage", - "America/Anguilla", - "America/Antigua", - "America/Araguaina", - "America/Argentina/Buenos_Aires", - "America/Argentina/Catamarca", - "America/Argentina/ComodRivadavia", - "America/Argentina/Cordoba", - "America/Argentina/Jujuy", - "America/Argentina/La_Rioja", - "America/Argentina/Mendoza", - "America/Argentina/Rio_Gallegos", - "America/Argentina/Salta", - "America/Argentina/San_Juan", - "America/Argentina/San_Luis", - "America/Argentina/Tucuman", - "America/Argentina/Ushuaia", - "America/Aruba", - "America/Asuncion", - "America/Atikokan", - "America/Atka", - "America/Bahia", - "America/Bahia_Banderas", - "America/Barbados", - "America/Belem", - "America/Belize", - "America/Blanc-Sablon", - "America/Boa_Vista", - "America/Bogota", - "America/Boise", - "America/Buenos_Aires", - "America/Cambridge_Bay", - "America/Campo_Grande", - "America/Cancun", - "America/Caracas", - "America/Catamarca", - "America/Cayenne", - "America/Cayman", - "America/Chicago", - "America/Chihuahua", - "America/Ciudad_Juarez", - "America/Coral_Harbour", - "America/Cordoba", - "America/Costa_Rica", - "America/Creston", - "America/Cuiaba", - "America/Curacao", - "America/Danmarkshavn", - "America/Dawson", - "America/Dawson_Creek", - "America/Denver", - "America/Detroit", - "America/Dominica", - "America/Edmonton", - "America/Eirunepe", - "America/El_Salvador", - "America/Ensenada", - "America/Fort_Nelson", - "America/Fort_Wayne", - "America/Fortaleza", - "America/Glace_Bay", - "America/Godthab", - "America/Goose_Bay", - "America/Grand_Turk", - "America/Grenada", - "America/Guadeloupe", - "America/Guatemala", - "America/Guayaquil", - "America/Guyana", - "America/Halifax", - "America/Havana", - "America/Hermosillo", - "America/Indiana/Indianapolis", - "America/Indiana/Knox", - "America/Indiana/Marengo", - "America/Indiana/Petersburg", - "America/Indiana/Tell_City", - "America/Indiana/Vevay", - "America/Indiana/Vincennes", - "America/Indiana/Winamac", - "America/Indianapolis", - "America/Inuvik", - "America/Iqaluit", - "America/Jamaica", - "America/Jujuy", - "America/Juneau", - "America/Kentucky/Louisville", - "America/Kentucky/Monticello", - "America/Knox_IN", - "America/Kralendijk", - "America/La_Paz", - "America/Lima", - "America/Los_Angeles", - "America/Louisville", - "America/Lower_Princes", - "America/Maceio", - "America/Managua", - "America/Manaus", - "America/Marigot", - "America/Martinique", - "America/Matamoros", - "America/Mazatlan", - "America/Mendoza", - "America/Menominee", - "America/Merida", - "America/Metlakatla", - "America/Mexico_City", - "America/Miquelon", - "America/Moncton", - "America/Monterrey", - "America/Montevideo", - "America/Montreal", - "America/Montserrat", - "America/Nassau", - "America/New_York", - "America/Nipigon", - "America/Nome", - "America/Noronha", - "America/North_Dakota/Beulah", - "America/North_Dakota/Center", - "America/North_Dakota/New_Salem", - "America/Nuuk", - "America/Ojinaga", - "America/Panama", - "America/Pangnirtung", - "America/Paramaribo", - "America/Phoenix", - "America/Port-au-Prince", - "America/Port_of_Spain", - "America/Porto_Acre", - "America/Porto_Velho", - "America/Puerto_Rico", - "America/Punta_Arenas", - "America/Rainy_River", - "America/Rankin_Inlet", - "America/Recife", - "America/Regina", - "America/Resolute", - "America/Rio_Branco", - "America/Rosario", - "America/Santa_Isabel", - "America/Santarem", - "America/Santiago", - "America/Santo_Domingo", - "America/Sao_Paulo", - "America/Scoresbysund", - "America/Shiprock", - "America/Sitka", - "America/St_Barthelemy", - "America/St_Johns", - "America/St_Kitts", - "America/St_Lucia", - "America/St_Thomas", - "America/St_Vincent", - "America/Swift_Current", - "America/Tegucigalpa", - "America/Thule", - "America/Thunder_Bay", - "America/Tijuana", - "America/Toronto", - "America/Tortola", - "America/Vancouver", - "America/Virgin", - "America/Whitehorse", - "America/Winnipeg", - "America/Yakutat", - "America/Yellowknife", - "Antarctica/Casey", - "Antarctica/Davis", - "Antarctica/DumontDUrville", - "Antarctica/Macquarie", - "Antarctica/Mawson", - "Antarctica/McMurdo", - "Antarctica/Palmer", - "Antarctica/Rothera", - "Antarctica/South_Pole", - "Antarctica/Syowa", - "Antarctica/Troll", - "Antarctica/Vostok", - "Arctic/Longyearbyen", - "Asia/Aden", - "Asia/Almaty", - "Asia/Amman", - "Asia/Anadyr", - "Asia/Aqtau", - "Asia/Aqtobe", - "Asia/Ashgabat", - "Asia/Ashkhabad", - "Asia/Atyrau", - "Asia/Baghdad", - "Asia/Bahrain", - "Asia/Baku", - "Asia/Bangkok", - "Asia/Barnaul", - "Asia/Beirut", - "Asia/Bishkek", - "Asia/Brunei", - "Asia/Calcutta", - "Asia/Chita", - "Asia/Choibalsan", - "Asia/Chongqing", - "Asia/Chungking", - "Asia/Colombo", - "Asia/Dacca", - "Asia/Damascus", - "Asia/Dhaka", - "Asia/Dili", - "Asia/Dubai", - "Asia/Dushanbe", - "Asia/Famagusta", - "Asia/Gaza", - "Asia/Harbin", - "Asia/Hebron", - "Asia/Ho_Chi_Minh", - "Asia/Hong_Kong", - "Asia/Hovd", - "Asia/Irkutsk", - "Asia/Istanbul", - "Asia/Jakarta", - "Asia/Jayapura", - "Asia/Jerusalem", - "Asia/Kabul", - "Asia/Kamchatka", - "Asia/Karachi", - "Asia/Kashgar", - "Asia/Kathmandu", - "Asia/Katmandu", - "Asia/Khandyga", - "Asia/Kolkata", - "Asia/Krasnoyarsk", - "Asia/Kuala_Lumpur", - "Asia/Kuching", - "Asia/Kuwait", - "Asia/Macao", - "Asia/Macau", - "Asia/Magadan", - "Asia/Makassar", - "Asia/Manila", - "Asia/Muscat", - "Asia/Nicosia", - "Asia/Novokuznetsk", - "Asia/Novosibirsk", - "Asia/Omsk", - "Asia/Oral", - "Asia/Phnom_Penh", - "Asia/Pontianak", - "Asia/Pyongyang", - "Asia/Qatar", - "Asia/Qostanay", - "Asia/Qyzylorda", - "Asia/Rangoon", - "Asia/Riyadh", - "Asia/Saigon", - "Asia/Sakhalin", - "Asia/Samarkand", - "Asia/Seoul", - "Asia/Shanghai", - "Asia/Singapore", - "Asia/Srednekolymsk", - "Asia/Taipei", - "Asia/Tashkent", - "Asia/Tbilisi", - "Asia/Tehran", - "Asia/Tel_Aviv", - "Asia/Thimbu", - "Asia/Thimphu", - "Asia/Tokyo", - "Asia/Tomsk", - "Asia/Ujung_Pandang", - "Asia/Ulaanbaatar", - "Asia/Ulan_Bator", - "Asia/Urumqi", - "Asia/Ust-Nera", - "Asia/Vientiane", - "Asia/Vladivostok", - "Asia/Yakutsk", - "Asia/Yangon", - "Asia/Yekaterinburg", - "Asia/Yerevan", - "Atlantic/Azores", - "Atlantic/Bermuda", - "Atlantic/Canary", - "Atlantic/Cape_Verde", - "Atlantic/Faeroe", - "Atlantic/Faroe", - "Atlantic/Jan_Mayen", - "Atlantic/Madeira", - "Atlantic/Reykjavik", - "Atlantic/South_Georgia", - "Atlantic/St_Helena", - "Atlantic/Stanley", - "Australia/ACT", - "Australia/Adelaide", - "Australia/Brisbane", - "Australia/Broken_Hill", - "Australia/Canberra", - "Australia/Currie", - "Australia/Darwin", - "Australia/Eucla", - "Australia/Hobart", - "Australia/LHI", - "Australia/Lindeman", - "Australia/Lord_Howe", - "Australia/Melbourne", - "Australia/NSW", - "Australia/North", - "Australia/Perth", - "Australia/Queensland", - "Australia/South", - "Australia/Sydney", - "Australia/Tasmania", - "Australia/Victoria", - "Australia/West", - "Australia/Yancowinna", - "Brazil/Acre", - "Brazil/DeNoronha", - "Brazil/East", - "Brazil/West", - "CET", - "CST6CDT", - "Canada/Atlantic", - "Canada/Central", - "Canada/Eastern", - "Canada/Mountain", - "Canada/Newfoundland", - "Canada/Pacific", - "Canada/Saskatchewan", - "Canada/Yukon", - "Chile/Continental", - "Chile/EasterIsland", - "Cuba", - "EET", - "EST", - "EST5EDT", - "Egypt", - "Eire", - "Etc/GMT", - "Etc/GMT+0", - "Etc/GMT+1", - "Etc/GMT+10", - "Etc/GMT+11", - "Etc/GMT+12", - "Etc/GMT+2", - "Etc/GMT+3", - "Etc/GMT+4", - "Etc/GMT+5", - "Etc/GMT+6", - "Etc/GMT+7", - "Etc/GMT+8", - "Etc/GMT+9", - "Etc/GMT-0", - "Etc/GMT-1", - "Etc/GMT-10", - "Etc/GMT-11", - "Etc/GMT-12", - "Etc/GMT-13", - "Etc/GMT-14", - "Etc/GMT-2", - "Etc/GMT-3", - "Etc/GMT-4", - "Etc/GMT-5", - "Etc/GMT-6", - "Etc/GMT-7", - "Etc/GMT-8", - "Etc/GMT-9", - "Etc/GMT0", - "Etc/Greenwich", - "Etc/UCT", - "Etc/UTC", - "Etc/Universal", - "Etc/Zulu", - "Europe/Amsterdam", - "Europe/Andorra", - "Europe/Astrakhan", - "Europe/Athens", - "Europe/Belfast", - "Europe/Belgrade", - "Europe/Berlin", - "Europe/Bratislava", - "Europe/Brussels", - "Europe/Bucharest", - "Europe/Budapest", - "Europe/Busingen", - "Europe/Chisinau", - "Europe/Copenhagen", - "Europe/Dublin", - "Europe/Gibraltar", - "Europe/Guernsey", - "Europe/Helsinki", - "Europe/Isle_of_Man", - "Europe/Istanbul", - "Europe/Jersey", - "Europe/Kaliningrad", - "Europe/Kiev", - "Europe/Kirov", - "Europe/Kyiv", - "Europe/Lisbon", - "Europe/Ljubljana", - "Europe/London", - "Europe/Luxembourg", - "Europe/Madrid", - "Europe/Malta", - "Europe/Mariehamn", - "Europe/Minsk", - "Europe/Monaco", - "Europe/Moscow", - "Europe/Nicosia", - "Europe/Oslo", - "Europe/Paris", - "Europe/Podgorica", - "Europe/Prague", - "Europe/Riga", - "Europe/Rome", - "Europe/Samara", - "Europe/San_Marino", - "Europe/Sarajevo", - "Europe/Saratov", - "Europe/Simferopol", - "Europe/Skopje", - "Europe/Sofia", - "Europe/Stockholm", - "Europe/Tallinn", - "Europe/Tirane", - "Europe/Tiraspol", - "Europe/Ulyanovsk", - "Europe/Uzhgorod", - "Europe/Vaduz", - "Europe/Vatican", - "Europe/Vienna", - "Europe/Vilnius", - "Europe/Volgograd", - "Europe/Warsaw", - "Europe/Zagreb", - "Europe/Zaporozhye", - "Europe/Zurich", - "GB", - "GB-Eire", - "GMT", - "GMT+0", - "GMT-0", - "GMT0", - "Greenwich", - "HST", - "Hongkong", - "Iceland", - "Indian/Antananarivo", - "Indian/Chagos", - "Indian/Christmas", - "Indian/Cocos", - "Indian/Comoro", - "Indian/Kerguelen", - "Indian/Mahe", - "Indian/Maldives", - "Indian/Mauritius", - "Indian/Mayotte", - "Indian/Reunion", - "Iran", - "Israel", - "Jamaica", - "Japan", - "Kwajalein", - "Libya", - "MET", - "MST", - "MST7MDT", - "Mexico/BajaNorte", - "Mexico/BajaSur", - "Mexico/General", - "NZ", - "NZ-CHAT", - "Navajo", - "PRC", - "PST8PDT", - "Pacific/Apia", - "Pacific/Auckland", - "Pacific/Bougainville", - "Pacific/Chatham", - "Pacific/Chuuk", - "Pacific/Easter", - "Pacific/Efate", - "Pacific/Enderbury", - "Pacific/Fakaofo", - "Pacific/Fiji", - "Pacific/Funafuti", - "Pacific/Galapagos", - "Pacific/Gambier", - "Pacific/Guadalcanal", - "Pacific/Guam", - "Pacific/Honolulu", - "Pacific/Johnston", - "Pacific/Kanton", - "Pacific/Kiritimati", - "Pacific/Kosrae", - "Pacific/Kwajalein", - "Pacific/Majuro", - "Pacific/Marquesas", - "Pacific/Midway", - "Pacific/Nauru", - "Pacific/Niue", - "Pacific/Norfolk", - "Pacific/Noumea", - "Pacific/Pago_Pago", - "Pacific/Palau", - "Pacific/Pitcairn", - "Pacific/Pohnpei", - "Pacific/Ponape", - "Pacific/Port_Moresby", - "Pacific/Rarotonga", - "Pacific/Saipan", - "Pacific/Samoa", - "Pacific/Tahiti", - "Pacific/Tarawa", - "Pacific/Tongatapu", - "Pacific/Truk", - "Pacific/Wake", - "Pacific/Wallis", - "Pacific/Yap", - "Poland", - "Portugal", - "ROC", - "ROK", - "Singapore", - "Turkey", - "UCT", - "US/Alaska", - "US/Aleutian", - "US/Arizona", - "US/Central", - "US/East-Indiana", - "US/Eastern", - "US/Hawaii", - "US/Indiana-Starke", - "US/Michigan", - "US/Mountain", - "US/Pacific", - "US/Samoa", - "UTC", - "Universal", - "W-SU", - "WET", - "Zulu", - }, - ( - "modules", - "pytz", - "common_timezones", - ): "['Africa/Abidjan', 'Africa/Accra', 'Africa/Addis_Ababa', 'Africa/Algiers', 'Africa/Asmara', 'Africa/Bamako', 'Africa/Bangui', 'Africa/Banjul', 'Africa/Bissau', 'Africa/Blantyre', 'Africa/Brazzaville', 'Africa/Bujumbura', 'Africa/Cairo', 'Africa/Casablanca', 'Africa/Ceuta', 'Africa/Conakry', 'Africa/Dakar', 'Africa/Dar_es_Salaam', 'Africa/Djibouti', 'Africa/Douala', 'Africa/El_Aaiun', 'Africa/Freetown', 'Africa/Gaborone', 'Africa/Harare', 'Africa/Johannesburg', 'Africa/Juba', 'Africa/Kampala', 'Africa/Khartoum', 'Africa/Kigali', 'Africa/Kinshasa', 'Africa/Lagos', 'Africa/Libreville', 'Africa/Lome', 'Africa/Luanda', 'Africa/Lubumbashi', 'Africa/Lusaka', 'Africa/Malabo', 'Africa/Maputo', 'Africa/Maseru', 'Africa/Mbabane', 'Africa/Mogadishu', 'Africa/Monrovia', 'Africa/Nairobi', 'Africa/Ndjamena', 'Africa/Niamey', 'Africa/Nouakchott', 'Africa/Ouagadougou', 'Africa/Porto-Novo', 'Africa/Sao_Tome', 'Africa/Tripoli', 'Africa/Tunis', 'Africa/Windhoek', 'America/Adak', 'America/Anchorage', 'America/Anguilla', 'America/Antigua', 'America/Araguaina', 'America/Argentina/Buenos_Aires', 'America/Argentina/Catamarca', 'America/Argentina/Cordoba', 'America/Argentina/Jujuy', 'America/Argentina/La_Rioja', 'America/Argentina/Mendoza', 'America/Argentina/Rio_Gallegos', 'America/Argentina/Salta', 'America/Argentina/San_Juan', 'America/Argentina/San_Luis', 'America/Argentina/Tucuman', 'America/Argentina/Ushuaia', 'America/Aruba', 'America/Asuncion', 'America/Atikokan', 'America/Bahia', 'America/Bahia_Banderas', 'America/Barbados', 'America/Belem', 'America/Belize', 'America/Blanc-Sablon', 'America/Boa_Vista', 'America/Bogota', 'America/Boise', 'America/Cambridge_Bay', 'America/Campo_Grande', 'America/Cancun', 'America/Caracas', 'America/Cayenne', 'America/Cayman', 'America/Chicago', 'America/Chihuahua', 'America/Ciudad_Juarez', 'America/Costa_Rica', 'America/Creston', 'America/Cuiaba', 'America/Curacao', 'America/Danmarkshavn', 'America/Dawson', 'America/Dawson_Creek', 'America/Denver', 'America/Detroit', 'America/Dominica', 'America/Edmonton', 'America/Eirunepe', 'America/El_Salvador', 'America/Fort_Nelson', 'America/Fortaleza', 'America/Glace_Bay', 'America/Goose_Bay', 'America/Grand_Turk', 'America/Grenada', 'America/Guadeloupe', 'America/Guatemala', 'America/Guayaquil', 'America/Guyana', 'America/Halifax', 'America/Havana', 'America/Hermosillo', 'America/Indiana/Indianapolis', 'America/Indiana/Knox', 'America/Indiana/Marengo', 'America/Indiana/Petersburg', 'America/Indiana/Tell_City', 'America/Indiana/Vevay', 'America/Indiana/Vincennes', 'America/Indiana/Winamac', 'America/Inuvik', 'America/Iqaluit', 'America/Jamaica', 'America/Juneau', 'America/Kentucky/Louisville', 'America/Kentucky/Monticello', 'America/Kralendijk', 'America/La_Paz', 'America/Lima', 'America/Los_Angeles', 'America/Lower_Princes', 'America/Maceio', 'America/Managua', 'America/Manaus', 'America/Marigot', 'America/Martinique', 'America/Matamoros', 'America/Mazatlan', 'America/Menominee', 'America/Merida', 'America/Metlakatla', 'America/Mexico_City', 'America/Miquelon', 'America/Moncton', 'America/Monterrey', 'America/Montevideo', 'America/Montserrat', 'America/Nassau', 'America/New_York', 'America/Nome', 'America/Noronha', 'America/North_Dakota/Beulah', 'America/North_Dakota/Center', 'America/North_Dakota/New_Salem', 'America/Nuuk', 'America/Ojinaga', 'America/Panama', 'America/Paramaribo', 'America/Phoenix', 'America/Port-au-Prince', 'America/Port_of_Spain', 'America/Porto_Velho', 'America/Puerto_Rico', 'America/Punta_Arenas', 'America/Rankin_Inlet', 'America/Recife', 'America/Regina', 'America/Resolute', 'America/Rio_Branco', 'America/Santarem', 'America/Santiago', 'America/Santo_Domingo', 'America/Sao_Paulo', 'America/Scoresbysund', 'America/Sitka', 'America/St_Barthelemy', 'America/St_Johns', 'America/St_Kitts', 'America/St_Lucia', 'America/St_Thomas', 'America/St_Vincent', 'America/Swift_Current', 'America/Tegucigalpa', 'America/Thule', 'America/Tijuana', 'America/Toronto', 'America/Tortola', 'America/Vancouver', 'America/Whitehorse', 'America/Winnipeg', 'America/Yakutat', 'Antarctica/Casey', 'Antarctica/Davis', 'Antarctica/DumontDUrville', 'Antarctica/Macquarie', 'Antarctica/Mawson', 'Antarctica/McMurdo', 'Antarctica/Palmer', 'Antarctica/Rothera', 'Antarctica/Syowa', 'Antarctica/Troll', 'Antarctica/Vostok', 'Arctic/Longyearbyen', 'Asia/Aden', 'Asia/Almaty', 'Asia/Amman', 'Asia/Anadyr', 'Asia/Aqtau', 'Asia/Aqtobe', 'Asia/Ashgabat', 'Asia/Atyrau', 'Asia/Baghdad', 'Asia/Bahrain', 'Asia/Baku', 'Asia/Bangkok', 'Asia/Barnaul', 'Asia/Beirut', 'Asia/Bishkek', 'Asia/Brunei', 'Asia/Chita', 'Asia/Choibalsan', 'Asia/Colombo', 'Asia/Damascus', 'Asia/Dhaka', 'Asia/Dili', 'Asia/Dubai', 'Asia/Dushanbe', 'Asia/Famagusta', 'Asia/Gaza', 'Asia/Hebron', 'Asia/Ho_Chi_Minh', 'Asia/Hong_Kong', 'Asia/Hovd', 'Asia/Irkutsk', 'Asia/Jakarta', 'Asia/Jayapura', 'Asia/Jerusalem', 'Asia/Kabul', 'Asia/Kamchatka', 'Asia/Karachi', 'Asia/Kathmandu', 'Asia/Khandyga', 'Asia/Kolkata', 'Asia/Krasnoyarsk', 'Asia/Kuala_Lumpur', 'Asia/Kuching', 'Asia/Kuwait', 'Asia/Macau', 'Asia/Magadan', 'Asia/Makassar', 'Asia/Manila', 'Asia/Muscat', 'Asia/Nicosia', 'Asia/Novokuznetsk', 'Asia/Novosibirsk', 'Asia/Omsk', 'Asia/Oral', 'Asia/Phnom_Penh', 'Asia/Pontianak', 'Asia/Pyongyang', 'Asia/Qatar', 'Asia/Qostanay', 'Asia/Qyzylorda', 'Asia/Riyadh', 'Asia/Sakhalin', 'Asia/Samarkand', 'Asia/Seoul', 'Asia/Shanghai', 'Asia/Singapore', 'Asia/Srednekolymsk', 'Asia/Taipei', 'Asia/Tashkent', 'Asia/Tbilisi', 'Asia/Tehran', 'Asia/Thimphu', 'Asia/Tokyo', 'Asia/Tomsk', 'Asia/Ulaanbaatar', 'Asia/Urumqi', 'Asia/Ust-Nera', 'Asia/Vientiane', 'Asia/Vladivostok', 'Asia/Yakutsk', 'Asia/Yangon', 'Asia/Yekaterinburg', 'Asia/Yerevan', 'Atlantic/Azores', 'Atlantic/Bermuda', 'Atlantic/Canary', 'Atlantic/Cape_Verde', 'Atlantic/Faroe', 'Atlantic/Madeira', 'Atlantic/Reykjavik', 'Atlantic/South_Georgia', 'Atlantic/St_Helena', 'Atlantic/Stanley', 'Australia/Adelaide', 'Australia/Brisbane', 'Australia/Broken_Hill', 'Australia/Darwin', 'Australia/Eucla', 'Australia/Hobart', 'Australia/Lindeman', 'Australia/Lord_Howe', 'Australia/Melbourne', 'Australia/Perth', 'Australia/Sydney', 'Canada/Atlantic', 'Canada/Central', 'Canada/Eastern', 'Canada/Mountain', 'Canada/Newfoundland', 'Canada/Pacific', 'Europe/Amsterdam', 'Europe/Andorra', 'Europe/Astrakhan', 'Europe/Athens', 'Europe/Belgrade', 'Europe/Berlin', 'Europe/Bratislava', 'Europe/Brussels', 'Europe/Bucharest', 'Europe/Budapest', 'Europe/Busingen', 'Europe/Chisinau', 'Europe/Copenhagen', 'Europe/Dublin', 'Europe/Gibraltar', 'Europe/Guernsey', 'Europe/Helsinki', 'Europe/Isle_of_Man', 'Europe/Istanbul', 'Europe/Jersey', 'Europe/Kaliningrad', 'Europe/Kirov', 'Europe/Kyiv', 'Europe/Lisbon', 'Europe/Ljubljana', 'Europe/London', 'Europe/Luxembourg', 'Europe/Madrid', 'Europe/Malta', 'Europe/Mariehamn', 'Europe/Minsk', 'Europe/Monaco', 'Europe/Moscow', 'Europe/Oslo', 'Europe/Paris', 'Europe/Podgorica', 'Europe/Prague', 'Europe/Riga', 'Europe/Rome', 'Europe/Samara', 'Europe/San_Marino', 'Europe/Sarajevo', 'Europe/Saratov', 'Europe/Simferopol', 'Europe/Skopje', 'Europe/Sofia', 'Europe/Stockholm', 'Europe/Tallinn', 'Europe/Tirane', 'Europe/Ulyanovsk', 'Europe/Vaduz', 'Europe/Vatican', 'Europe/Vienna', 'Europe/Vilnius', 'Europe/Volgograd', 'Europe/Warsaw', 'Europe/Zagreb', 'Europe/Zurich', 'GMT', 'Indian/Antananarivo', 'Indian/Chagos', 'Indian/Christmas', 'Indian/Cocos', 'Indian/Comoro', 'Indian/Kerguelen', 'Indian/Mahe', 'Indian/Maldives', 'Indian/Mauritius', 'Indian/Mayotte', 'Indian/Reunion', 'Pacific/Apia', 'Pacific/Auckland', 'Pacific/Bougainville', 'Pacific/Chatham', 'Pacific/Chuuk', 'Pacific/Easter', 'Pacific/Efate', 'Pacific/Fakaofo', 'Pacific/Fiji', 'Pacific/Funafuti', 'Pacific/Galapagos', 'Pacific/Gambier', 'Pacific/Guadalcanal', 'Pacific/Guam', 'Pacific/Honolulu', 'Pacific/Kanton', 'Pacific/Kiritimati', 'Pacific/Kosrae', 'Pacific/Kwajalein', 'Pacific/Majuro', 'Pacific/Marquesas', 'Pacific/Midway', 'Pacific/Nauru', 'Pacific/Niue', 'Pacific/Norfolk', 'Pacific/Noumea', 'Pacific/Pago_Pago', 'Pacific/Palau', 'Pacific/Pitcairn', 'Pacific/Pohnpei', 'Pacific/Port_Moresby', 'Pacific/Rarotonga', 'Pacific/Saipan', 'Pacific/Tahiti', 'Pacific/Tarawa', 'Pacific/Tongatapu', 'Pacific/Wake', 'Pacific/Wallis', 'US/Alaska', 'US/Arizona', 'US/Central', 'US/Eastern', 'US/Hawaii', 'US/Mountain', 'US/Pacific', 'UTC']", + ("modules", "pytz", "all_timezones"): str(pytz.all_timezones), + ("modules", "pytz", "all_timezones_set"): pytz.all_timezones_set, + ("modules", "pytz", "common_timezones"): str(pytz.common_timezones), ("modules", "pytz", "common_timezones_set"): set(), ("modules", "pytz", "BaseTzInfo"): "", ("modules", "pytz", "FixedOffset"): "", From 9f5dea302eeb561dcdfc4b540d00c5696102e574 Mon Sep 17 00:00:00 2001 From: Kshitij Aranke Date: Mon, 9 Sep 2024 15:04:26 +0100 Subject: [PATCH 03/19] simplify pytz pt2 --- tests/unit/context/test_context.py | 609 +---------------------------- 1 file changed, 11 insertions(+), 598 deletions(-) diff --git a/tests/unit/context/test_context.py b/tests/unit/context/test_context.py index 600648f3710..bf85c0fc678 100644 --- a/tests/unit/context/test_context.py +++ b/tests/unit/context/test_context.py @@ -281,13 +281,15 @@ def assert_has_keys(required_keys: Set[str], maybe_keys: Set[str], ctx: Dict[str "config-version": 2, } -PYTZ_COUNTRY_TIMEZONES_LIST = country_timezones_list = [ - ( - ["modules", "pytz", "country_timezones", country_code], - str(pytz.country_timezones[country_code]), - ) - for country_code in pytz.country_timezones -] +PYTZ_COUNTRY_TIMEZONES = { + ("modules", "pytz", "country_timezones", country_code): str(timezones) + for country_code, timezones in pytz.country_timezones.items() +} + +PYTZ_COUNTRY_NAMES = { + ("modules", "pytz", "country_names", country_code): country_name + for country_code, country_name in pytz.country_names.items() +} EXPECTED_MODEL_CONTEXT = { ("var",): {}, @@ -633,597 +635,8 @@ def assert_has_keys(required_keys: Set[str], maybe_keys: Set[str], ctx: Dict[str ): "", ("invocation_args_dict", "warn_error_options", "include"): "[]", ("invocation_args_dict", "warn_error_options", "exclude"): "[]", - ("modules", "pytz", "country_timezones", "AD"): "['Europe/Andorra']", - ("modules", "pytz", "country_timezones", "AE"): "['Asia/Dubai']", - ("modules", "pytz", "country_timezones", "AF"): "['Asia/Kabul']", - ("modules", "pytz", "country_timezones", "AG"): "['America/Antigua']", - ("modules", "pytz", "country_timezones", "AI"): "['America/Anguilla']", - ("modules", "pytz", "country_timezones", "AL"): "['Europe/Tirane']", - ("modules", "pytz", "country_timezones", "AM"): "['Asia/Yerevan']", - ("modules", "pytz", "country_timezones", "AO"): "['Africa/Luanda']", - ( - "modules", - "pytz", - "country_timezones", - "AQ", - ): "['Antarctica/McMurdo', 'Antarctica/Casey', 'Antarctica/Davis', 'Antarctica/DumontDUrville', 'Antarctica/Mawson', 'Antarctica/Palmer', 'Antarctica/Rothera', 'Antarctica/Syowa', 'Antarctica/Troll', 'Antarctica/Vostok']", - ( - "modules", - "pytz", - "country_timezones", - "AR", - ): "['America/Argentina/Buenos_Aires', 'America/Argentina/Cordoba', 'America/Argentina/Salta', 'America/Argentina/Jujuy', 'America/Argentina/Tucuman', 'America/Argentina/Catamarca', 'America/Argentina/La_Rioja', 'America/Argentina/San_Juan', 'America/Argentina/Mendoza', 'America/Argentina/San_Luis', 'America/Argentina/Rio_Gallegos', 'America/Argentina/Ushuaia']", - ("modules", "pytz", "country_timezones", "AS"): "['Pacific/Pago_Pago']", - ("modules", "pytz", "country_timezones", "AT"): "['Europe/Vienna']", - ( - "modules", - "pytz", - "country_timezones", - "AU", - ): "['Australia/Lord_Howe', 'Antarctica/Macquarie', 'Australia/Hobart', 'Australia/Melbourne', 'Australia/Sydney', 'Australia/Broken_Hill', 'Australia/Brisbane', 'Australia/Lindeman', 'Australia/Adelaide', 'Australia/Darwin', 'Australia/Perth', 'Australia/Eucla']", - ("modules", "pytz", "country_timezones", "AW"): "['America/Aruba']", - ("modules", "pytz", "country_timezones", "AX"): "['Europe/Mariehamn']", - ("modules", "pytz", "country_timezones", "AZ"): "['Asia/Baku']", - ("modules", "pytz", "country_timezones", "BA"): "['Europe/Sarajevo']", - ("modules", "pytz", "country_timezones", "BB"): "['America/Barbados']", - ("modules", "pytz", "country_timezones", "BD"): "['Asia/Dhaka']", - ("modules", "pytz", "country_timezones", "BE"): "['Europe/Brussels']", - ("modules", "pytz", "country_timezones", "BF"): "['Africa/Ouagadougou']", - ("modules", "pytz", "country_timezones", "BG"): "['Europe/Sofia']", - ("modules", "pytz", "country_timezones", "BH"): "['Asia/Bahrain']", - ("modules", "pytz", "country_timezones", "BI"): "['Africa/Bujumbura']", - ("modules", "pytz", "country_timezones", "BJ"): "['Africa/Porto-Novo']", - ("modules", "pytz", "country_timezones", "BL"): "['America/St_Barthelemy']", - ("modules", "pytz", "country_timezones", "BM"): "['Atlantic/Bermuda']", - ("modules", "pytz", "country_timezones", "BN"): "['Asia/Brunei']", - ("modules", "pytz", "country_timezones", "BO"): "['America/La_Paz']", - ("modules", "pytz", "country_timezones", "BQ"): "['America/Kralendijk']", - ( - "modules", - "pytz", - "country_timezones", - "BR", - ): "['America/Noronha', 'America/Belem', 'America/Fortaleza', 'America/Recife', 'America/Araguaina', 'America/Maceio', 'America/Bahia', 'America/Sao_Paulo', 'America/Campo_Grande', 'America/Cuiaba', 'America/Santarem', 'America/Porto_Velho', 'America/Boa_Vista', 'America/Manaus', 'America/Eirunepe', 'America/Rio_Branco']", - ("modules", "pytz", "country_timezones", "BS"): "['America/Nassau']", - ("modules", "pytz", "country_timezones", "BT"): "['Asia/Thimphu']", - ("modules", "pytz", "country_timezones", "BW"): "['Africa/Gaborone']", - ("modules", "pytz", "country_timezones", "BY"): "['Europe/Minsk']", - ("modules", "pytz", "country_timezones", "BZ"): "['America/Belize']", - ( - "modules", - "pytz", - "country_timezones", - "CA", - ): "['America/St_Johns', 'America/Halifax', 'America/Glace_Bay', 'America/Moncton', 'America/Goose_Bay', 'America/Blanc-Sablon', 'America/Toronto', 'America/Iqaluit', 'America/Atikokan', 'America/Winnipeg', 'America/Resolute', 'America/Rankin_Inlet', 'America/Regina', 'America/Swift_Current', 'America/Edmonton', 'America/Cambridge_Bay', 'America/Inuvik', 'America/Creston', 'America/Dawson_Creek', 'America/Fort_Nelson', 'America/Whitehorse', 'America/Dawson', 'America/Vancouver']", - ("modules", "pytz", "country_timezones", "CC"): "['Indian/Cocos']", - ("modules", "pytz", "country_timezones", "CD"): "['Africa/Kinshasa', 'Africa/Lubumbashi']", - ("modules", "pytz", "country_timezones", "CF"): "['Africa/Bangui']", - ("modules", "pytz", "country_timezones", "CG"): "['Africa/Brazzaville']", - ("modules", "pytz", "country_timezones", "CH"): "['Europe/Zurich']", - ("modules", "pytz", "country_timezones", "CI"): "['Africa/Abidjan']", - ("modules", "pytz", "country_timezones", "CK"): "['Pacific/Rarotonga']", - ( - "modules", - "pytz", - "country_timezones", - "CL", - ): "['America/Santiago', 'America/Punta_Arenas', 'Pacific/Easter']", - ("modules", "pytz", "country_timezones", "CM"): "['Africa/Douala']", - ("modules", "pytz", "country_timezones", "CN"): "['Asia/Shanghai', 'Asia/Urumqi']", - ("modules", "pytz", "country_timezones", "CO"): "['America/Bogota']", - ("modules", "pytz", "country_timezones", "CR"): "['America/Costa_Rica']", - ("modules", "pytz", "country_timezones", "CU"): "['America/Havana']", - ("modules", "pytz", "country_timezones", "CV"): "['Atlantic/Cape_Verde']", - ("modules", "pytz", "country_timezones", "CW"): "['America/Curacao']", - ("modules", "pytz", "country_timezones", "CX"): "['Indian/Christmas']", - ("modules", "pytz", "country_timezones", "CY"): "['Asia/Nicosia', 'Asia/Famagusta']", - ("modules", "pytz", "country_timezones", "CZ"): "['Europe/Prague']", - ("modules", "pytz", "country_timezones", "DE"): "['Europe/Berlin', 'Europe/Busingen']", - ("modules", "pytz", "country_timezones", "DJ"): "['Africa/Djibouti']", - ("modules", "pytz", "country_timezones", "DK"): "['Europe/Copenhagen']", - ("modules", "pytz", "country_timezones", "DM"): "['America/Dominica']", - ("modules", "pytz", "country_timezones", "DO"): "['America/Santo_Domingo']", - ("modules", "pytz", "country_timezones", "DZ"): "['Africa/Algiers']", - ("modules", "pytz", "country_timezones", "EC"): "['America/Guayaquil', 'Pacific/Galapagos']", - ("modules", "pytz", "country_timezones", "EE"): "['Europe/Tallinn']", - ("modules", "pytz", "country_timezones", "EG"): "['Africa/Cairo']", - ("modules", "pytz", "country_timezones", "EH"): "['Africa/El_Aaiun']", - ("modules", "pytz", "country_timezones", "ER"): "['Africa/Asmara']", - ( - "modules", - "pytz", - "country_timezones", - "ES", - ): "['Europe/Madrid', 'Africa/Ceuta', 'Atlantic/Canary']", - ("modules", "pytz", "country_timezones", "ET"): "['Africa/Addis_Ababa']", - ("modules", "pytz", "country_timezones", "FI"): "['Europe/Helsinki']", - ("modules", "pytz", "country_timezones", "FJ"): "['Pacific/Fiji']", - ("modules", "pytz", "country_timezones", "FK"): "['Atlantic/Stanley']", - ( - "modules", - "pytz", - "country_timezones", - "FM", - ): "['Pacific/Chuuk', 'Pacific/Pohnpei', 'Pacific/Kosrae']", - ("modules", "pytz", "country_timezones", "FO"): "['Atlantic/Faroe']", - ("modules", "pytz", "country_timezones", "FR"): "['Europe/Paris']", - ("modules", "pytz", "country_timezones", "GA"): "['Africa/Libreville']", - ("modules", "pytz", "country_timezones", "GB"): "['Europe/London']", - ("modules", "pytz", "country_timezones", "GD"): "['America/Grenada']", - ("modules", "pytz", "country_timezones", "GE"): "['Asia/Tbilisi']", - ("modules", "pytz", "country_timezones", "GF"): "['America/Cayenne']", - ("modules", "pytz", "country_timezones", "GG"): "['Europe/Guernsey']", - ("modules", "pytz", "country_timezones", "GH"): "['Africa/Accra']", - ("modules", "pytz", "country_timezones", "GI"): "['Europe/Gibraltar']", - ( - "modules", - "pytz", - "country_timezones", - "GL", - ): "['America/Nuuk', 'America/Danmarkshavn', 'America/Scoresbysund', 'America/Thule']", - ("modules", "pytz", "country_timezones", "GM"): "['Africa/Banjul']", - ("modules", "pytz", "country_timezones", "GN"): "['Africa/Conakry']", - ("modules", "pytz", "country_timezones", "GP"): "['America/Guadeloupe']", - ("modules", "pytz", "country_timezones", "GQ"): "['Africa/Malabo']", - ("modules", "pytz", "country_timezones", "GR"): "['Europe/Athens']", - ("modules", "pytz", "country_timezones", "GS"): "['Atlantic/South_Georgia']", - ("modules", "pytz", "country_timezones", "GT"): "['America/Guatemala']", - ("modules", "pytz", "country_timezones", "GU"): "['Pacific/Guam']", - ("modules", "pytz", "country_timezones", "GW"): "['Africa/Bissau']", - ("modules", "pytz", "country_timezones", "GY"): "['America/Guyana']", - ("modules", "pytz", "country_timezones", "HK"): "['Asia/Hong_Kong']", - ("modules", "pytz", "country_timezones", "HN"): "['America/Tegucigalpa']", - ("modules", "pytz", "country_timezones", "HR"): "['Europe/Zagreb']", - ("modules", "pytz", "country_timezones", "HT"): "['America/Port-au-Prince']", - ("modules", "pytz", "country_timezones", "HU"): "['Europe/Budapest']", - ( - "modules", - "pytz", - "country_timezones", - "ID", - ): "['Asia/Jakarta', 'Asia/Pontianak', 'Asia/Makassar', 'Asia/Jayapura']", - ("modules", "pytz", "country_timezones", "IE"): "['Europe/Dublin']", - ("modules", "pytz", "country_timezones", "IL"): "['Asia/Jerusalem']", - ("modules", "pytz", "country_timezones", "IM"): "['Europe/Isle_of_Man']", - ("modules", "pytz", "country_timezones", "IN"): "['Asia/Kolkata']", - ("modules", "pytz", "country_timezones", "IO"): "['Indian/Chagos']", - ("modules", "pytz", "country_timezones", "IQ"): "['Asia/Baghdad']", - ("modules", "pytz", "country_timezones", "IR"): "['Asia/Tehran']", - ("modules", "pytz", "country_timezones", "IS"): "['Atlantic/Reykjavik']", - ("modules", "pytz", "country_timezones", "IT"): "['Europe/Rome']", - ("modules", "pytz", "country_timezones", "JE"): "['Europe/Jersey']", - ("modules", "pytz", "country_timezones", "JM"): "['America/Jamaica']", - ("modules", "pytz", "country_timezones", "JO"): "['Asia/Amman']", - ("modules", "pytz", "country_timezones", "JP"): "['Asia/Tokyo']", - ("modules", "pytz", "country_timezones", "KE"): "['Africa/Nairobi']", - ("modules", "pytz", "country_timezones", "KG"): "['Asia/Bishkek']", - ("modules", "pytz", "country_timezones", "KH"): "['Asia/Phnom_Penh']", - ( - "modules", - "pytz", - "country_timezones", - "KI", - ): "['Pacific/Tarawa', 'Pacific/Kanton', 'Pacific/Kiritimati']", - ("modules", "pytz", "country_timezones", "KM"): "['Indian/Comoro']", - ("modules", "pytz", "country_timezones", "KN"): "['America/St_Kitts']", - ("modules", "pytz", "country_timezones", "KP"): "['Asia/Pyongyang']", - ("modules", "pytz", "country_timezones", "KR"): "['Asia/Seoul']", - ("modules", "pytz", "country_timezones", "KW"): "['Asia/Kuwait']", - ("modules", "pytz", "country_timezones", "KY"): "['America/Cayman']", - ( - "modules", - "pytz", - "country_timezones", - "KZ", - ): "['Asia/Almaty', 'Asia/Qyzylorda', 'Asia/Qostanay', 'Asia/Aqtobe', 'Asia/Aqtau', 'Asia/Atyrau', 'Asia/Oral']", - ("modules", "pytz", "country_timezones", "LA"): "['Asia/Vientiane']", - ("modules", "pytz", "country_timezones", "LB"): "['Asia/Beirut']", - ("modules", "pytz", "country_timezones", "LC"): "['America/St_Lucia']", - ("modules", "pytz", "country_timezones", "LI"): "['Europe/Vaduz']", - ("modules", "pytz", "country_timezones", "LK"): "['Asia/Colombo']", - ("modules", "pytz", "country_timezones", "LR"): "['Africa/Monrovia']", - ("modules", "pytz", "country_timezones", "LS"): "['Africa/Maseru']", - ("modules", "pytz", "country_timezones", "LT"): "['Europe/Vilnius']", - ("modules", "pytz", "country_timezones", "LU"): "['Europe/Luxembourg']", - ("modules", "pytz", "country_timezones", "LV"): "['Europe/Riga']", - ("modules", "pytz", "country_timezones", "LY"): "['Africa/Tripoli']", - ("modules", "pytz", "country_timezones", "MA"): "['Africa/Casablanca']", - ("modules", "pytz", "country_timezones", "MC"): "['Europe/Monaco']", - ("modules", "pytz", "country_timezones", "MD"): "['Europe/Chisinau']", - ("modules", "pytz", "country_timezones", "ME"): "['Europe/Podgorica']", - ("modules", "pytz", "country_timezones", "MF"): "['America/Marigot']", - ("modules", "pytz", "country_timezones", "MG"): "['Indian/Antananarivo']", - ("modules", "pytz", "country_timezones", "MH"): "['Pacific/Majuro', 'Pacific/Kwajalein']", - ("modules", "pytz", "country_timezones", "MK"): "['Europe/Skopje']", - ("modules", "pytz", "country_timezones", "ML"): "['Africa/Bamako']", - ("modules", "pytz", "country_timezones", "MM"): "['Asia/Yangon']", - ( - "modules", - "pytz", - "country_timezones", - "MN", - ): "['Asia/Ulaanbaatar', 'Asia/Hovd', 'Asia/Choibalsan']", - ("modules", "pytz", "country_timezones", "MO"): "['Asia/Macau']", - ("modules", "pytz", "country_timezones", "MP"): "['Pacific/Saipan']", - ("modules", "pytz", "country_timezones", "MQ"): "['America/Martinique']", - ("modules", "pytz", "country_timezones", "MR"): "['Africa/Nouakchott']", - ("modules", "pytz", "country_timezones", "MS"): "['America/Montserrat']", - ("modules", "pytz", "country_timezones", "MT"): "['Europe/Malta']", - ("modules", "pytz", "country_timezones", "MU"): "['Indian/Mauritius']", - ("modules", "pytz", "country_timezones", "MV"): "['Indian/Maldives']", - ("modules", "pytz", "country_timezones", "MW"): "['Africa/Blantyre']", - ( - "modules", - "pytz", - "country_timezones", - "MX", - ): "['America/Mexico_City', 'America/Cancun', 'America/Merida', 'America/Monterrey', 'America/Matamoros', 'America/Chihuahua', 'America/Ciudad_Juarez', 'America/Ojinaga', 'America/Mazatlan', 'America/Bahia_Banderas', 'America/Hermosillo', 'America/Tijuana']", - ("modules", "pytz", "country_timezones", "MY"): "['Asia/Kuala_Lumpur', 'Asia/Kuching']", - ("modules", "pytz", "country_timezones", "MZ"): "['Africa/Maputo']", - ("modules", "pytz", "country_timezones", "NA"): "['Africa/Windhoek']", - ("modules", "pytz", "country_timezones", "NC"): "['Pacific/Noumea']", - ("modules", "pytz", "country_timezones", "NE"): "['Africa/Niamey']", - ("modules", "pytz", "country_timezones", "NF"): "['Pacific/Norfolk']", - ("modules", "pytz", "country_timezones", "NG"): "['Africa/Lagos']", - ("modules", "pytz", "country_timezones", "NI"): "['America/Managua']", - ("modules", "pytz", "country_timezones", "NL"): "['Europe/Amsterdam']", - ("modules", "pytz", "country_timezones", "NO"): "['Europe/Oslo']", - ("modules", "pytz", "country_timezones", "NP"): "['Asia/Kathmandu']", - ("modules", "pytz", "country_timezones", "NR"): "['Pacific/Nauru']", - ("modules", "pytz", "country_timezones", "NU"): "['Pacific/Niue']", - ("modules", "pytz", "country_timezones", "NZ"): "['Pacific/Auckland', 'Pacific/Chatham']", - ("modules", "pytz", "country_timezones", "OM"): "['Asia/Muscat']", - ("modules", "pytz", "country_timezones", "PA"): "['America/Panama']", - ("modules", "pytz", "country_timezones", "PE"): "['America/Lima']", - ( - "modules", - "pytz", - "country_timezones", - "PF", - ): "['Pacific/Tahiti', 'Pacific/Marquesas', 'Pacific/Gambier']", - ( - "modules", - "pytz", - "country_timezones", - "PG", - ): "['Pacific/Port_Moresby', 'Pacific/Bougainville']", - ("modules", "pytz", "country_timezones", "PH"): "['Asia/Manila']", - ("modules", "pytz", "country_timezones", "PK"): "['Asia/Karachi']", - ("modules", "pytz", "country_timezones", "PL"): "['Europe/Warsaw']", - ("modules", "pytz", "country_timezones", "PM"): "['America/Miquelon']", - ("modules", "pytz", "country_timezones", "PN"): "['Pacific/Pitcairn']", - ("modules", "pytz", "country_timezones", "PR"): "['America/Puerto_Rico']", - ("modules", "pytz", "country_timezones", "PS"): "['Asia/Gaza', 'Asia/Hebron']", - ( - "modules", - "pytz", - "country_timezones", - "PT", - ): "['Europe/Lisbon', 'Atlantic/Madeira', 'Atlantic/Azores']", - ("modules", "pytz", "country_timezones", "PW"): "['Pacific/Palau']", - ("modules", "pytz", "country_timezones", "PY"): "['America/Asuncion']", - ("modules", "pytz", "country_timezones", "QA"): "['Asia/Qatar']", - ("modules", "pytz", "country_timezones", "RE"): "['Indian/Reunion']", - ("modules", "pytz", "country_timezones", "RO"): "['Europe/Bucharest']", - ("modules", "pytz", "country_timezones", "RS"): "['Europe/Belgrade']", - ( - "modules", - "pytz", - "country_timezones", - "RU", - ): "['Europe/Kaliningrad', 'Europe/Moscow', 'Europe/Kirov', 'Europe/Volgograd', 'Europe/Astrakhan', 'Europe/Saratov', 'Europe/Ulyanovsk', 'Europe/Samara', 'Asia/Yekaterinburg', 'Asia/Omsk', 'Asia/Novosibirsk', 'Asia/Barnaul', 'Asia/Tomsk', 'Asia/Novokuznetsk', 'Asia/Krasnoyarsk', 'Asia/Irkutsk', 'Asia/Chita', 'Asia/Yakutsk', 'Asia/Khandyga', 'Asia/Vladivostok', 'Asia/Ust-Nera', 'Asia/Magadan', 'Asia/Sakhalin', 'Asia/Srednekolymsk', 'Asia/Kamchatka', 'Asia/Anadyr']", - ("modules", "pytz", "country_timezones", "UA"): "['Europe/Simferopol', 'Europe/Kyiv']", - ("modules", "pytz", "country_timezones", "RW"): "['Africa/Kigali']", - ("modules", "pytz", "country_timezones", "SA"): "['Asia/Riyadh']", - ("modules", "pytz", "country_timezones", "SB"): "['Pacific/Guadalcanal']", - ("modules", "pytz", "country_timezones", "SC"): "['Indian/Mahe']", - ("modules", "pytz", "country_timezones", "SD"): "['Africa/Khartoum']", - ("modules", "pytz", "country_timezones", "SE"): "['Europe/Stockholm']", - ("modules", "pytz", "country_timezones", "SG"): "['Asia/Singapore']", - ("modules", "pytz", "country_timezones", "SH"): "['Atlantic/St_Helena']", - ("modules", "pytz", "country_timezones", "SI"): "['Europe/Ljubljana']", - ("modules", "pytz", "country_timezones", "SJ"): "['Arctic/Longyearbyen']", - ("modules", "pytz", "country_timezones", "SK"): "['Europe/Bratislava']", - ("modules", "pytz", "country_timezones", "SL"): "['Africa/Freetown']", - ("modules", "pytz", "country_timezones", "SM"): "['Europe/San_Marino']", - ("modules", "pytz", "country_timezones", "SN"): "['Africa/Dakar']", - ("modules", "pytz", "country_timezones", "SO"): "['Africa/Mogadishu']", - ("modules", "pytz", "country_timezones", "SR"): "['America/Paramaribo']", - ("modules", "pytz", "country_timezones", "SS"): "['Africa/Juba']", - ("modules", "pytz", "country_timezones", "ST"): "['Africa/Sao_Tome']", - ("modules", "pytz", "country_timezones", "SV"): "['America/El_Salvador']", - ("modules", "pytz", "country_timezones", "SX"): "['America/Lower_Princes']", - ("modules", "pytz", "country_timezones", "SY"): "['Asia/Damascus']", - ("modules", "pytz", "country_timezones", "SZ"): "['Africa/Mbabane']", - ("modules", "pytz", "country_timezones", "TC"): "['America/Grand_Turk']", - ("modules", "pytz", "country_timezones", "TD"): "['Africa/Ndjamena']", - ("modules", "pytz", "country_timezones", "TF"): "['Indian/Kerguelen']", - ("modules", "pytz", "country_timezones", "TG"): "['Africa/Lome']", - ("modules", "pytz", "country_timezones", "TH"): "['Asia/Bangkok']", - ("modules", "pytz", "country_timezones", "TJ"): "['Asia/Dushanbe']", - ("modules", "pytz", "country_timezones", "TK"): "['Pacific/Fakaofo']", - ("modules", "pytz", "country_timezones", "TL"): "['Asia/Dili']", - ("modules", "pytz", "country_timezones", "TM"): "['Asia/Ashgabat']", - ("modules", "pytz", "country_timezones", "TN"): "['Africa/Tunis']", - ("modules", "pytz", "country_timezones", "TO"): "['Pacific/Tongatapu']", - ("modules", "pytz", "country_timezones", "TR"): "['Europe/Istanbul']", - ("modules", "pytz", "country_timezones", "TT"): "['America/Port_of_Spain']", - ("modules", "pytz", "country_timezones", "TV"): "['Pacific/Funafuti']", - ("modules", "pytz", "country_timezones", "TW"): "['Asia/Taipei']", - ("modules", "pytz", "country_timezones", "TZ"): "['Africa/Dar_es_Salaam']", - ("modules", "pytz", "country_timezones", "UG"): "['Africa/Kampala']", - ("modules", "pytz", "country_timezones", "UM"): "['Pacific/Midway', 'Pacific/Wake']", - ( - "modules", - "pytz", - "country_timezones", - "US", - ): "['America/New_York', 'America/Detroit', 'America/Kentucky/Louisville', 'America/Kentucky/Monticello', 'America/Indiana/Indianapolis', 'America/Indiana/Vincennes', 'America/Indiana/Winamac', 'America/Indiana/Marengo', 'America/Indiana/Petersburg', 'America/Indiana/Vevay', 'America/Chicago', 'America/Indiana/Tell_City', 'America/Indiana/Knox', 'America/Menominee', 'America/North_Dakota/Center', 'America/North_Dakota/New_Salem', 'America/North_Dakota/Beulah', 'America/Denver', 'America/Boise', 'America/Phoenix', 'America/Los_Angeles', 'America/Anchorage', 'America/Juneau', 'America/Sitka', 'America/Metlakatla', 'America/Yakutat', 'America/Nome', 'America/Adak', 'Pacific/Honolulu']", - ("modules", "pytz", "country_timezones", "UY"): "['America/Montevideo']", - ("modules", "pytz", "country_timezones", "UZ"): "['Asia/Samarkand', 'Asia/Tashkent']", - ("modules", "pytz", "country_timezones", "VA"): "['Europe/Vatican']", - ("modules", "pytz", "country_timezones", "VC"): "['America/St_Vincent']", - ("modules", "pytz", "country_timezones", "VE"): "['America/Caracas']", - ("modules", "pytz", "country_timezones", "VG"): "['America/Tortola']", - ("modules", "pytz", "country_timezones", "VI"): "['America/St_Thomas']", - ("modules", "pytz", "country_timezones", "VN"): "['Asia/Ho_Chi_Minh']", - ("modules", "pytz", "country_timezones", "VU"): "['Pacific/Efate']", - ("modules", "pytz", "country_timezones", "WF"): "['Pacific/Wallis']", - ("modules", "pytz", "country_timezones", "WS"): "['Pacific/Apia']", - ("modules", "pytz", "country_timezones", "YE"): "['Asia/Aden']", - ("modules", "pytz", "country_timezones", "YT"): "['Indian/Mayotte']", - ("modules", "pytz", "country_timezones", "ZA"): "['Africa/Johannesburg']", - ("modules", "pytz", "country_timezones", "ZM"): "['Africa/Lusaka']", - ("modules", "pytz", "country_timezones", "ZW"): "['Africa/Harare']", - ("modules", "pytz", "country_names", "AD"): "Andorra", - ("modules", "pytz", "country_names", "AE"): "United Arab Emirates", - ("modules", "pytz", "country_names", "AF"): "Afghanistan", - ("modules", "pytz", "country_names", "AG"): "Antigua & Barbuda", - ("modules", "pytz", "country_names", "AI"): "Anguilla", - ("modules", "pytz", "country_names", "AL"): "Albania", - ("modules", "pytz", "country_names", "AM"): "Armenia", - ("modules", "pytz", "country_names", "AO"): "Angola", - ("modules", "pytz", "country_names", "AQ"): "Antarctica", - ("modules", "pytz", "country_names", "AR"): "Argentina", - ("modules", "pytz", "country_names", "AS"): "Samoa (American)", - ("modules", "pytz", "country_names", "AT"): "Austria", - ("modules", "pytz", "country_names", "AU"): "Australia", - ("modules", "pytz", "country_names", "AW"): "Aruba", - ("modules", "pytz", "country_names", "AX"): "Åland Islands", - ("modules", "pytz", "country_names", "AZ"): "Azerbaijan", - ("modules", "pytz", "country_names", "BA"): "Bosnia & Herzegovina", - ("modules", "pytz", "country_names", "BB"): "Barbados", - ("modules", "pytz", "country_names", "BD"): "Bangladesh", - ("modules", "pytz", "country_names", "BE"): "Belgium", - ("modules", "pytz", "country_names", "BF"): "Burkina Faso", - ("modules", "pytz", "country_names", "BG"): "Bulgaria", - ("modules", "pytz", "country_names", "BH"): "Bahrain", - ("modules", "pytz", "country_names", "BI"): "Burundi", - ("modules", "pytz", "country_names", "BJ"): "Benin", - ("modules", "pytz", "country_names", "BL"): "St Barthelemy", - ("modules", "pytz", "country_names", "BM"): "Bermuda", - ("modules", "pytz", "country_names", "BN"): "Brunei", - ("modules", "pytz", "country_names", "BO"): "Bolivia", - ("modules", "pytz", "country_names", "BQ"): "Caribbean NL", - ("modules", "pytz", "country_names", "BR"): "Brazil", - ("modules", "pytz", "country_names", "BS"): "Bahamas", - ("modules", "pytz", "country_names", "BT"): "Bhutan", - ("modules", "pytz", "country_names", "BV"): "Bouvet Island", - ("modules", "pytz", "country_names", "BW"): "Botswana", - ("modules", "pytz", "country_names", "BY"): "Belarus", - ("modules", "pytz", "country_names", "BZ"): "Belize", - ("modules", "pytz", "country_names", "CA"): "Canada", - ("modules", "pytz", "country_names", "CC"): "Cocos (Keeling) Islands", - ("modules", "pytz", "country_names", "CD"): "Congo (Dem. Rep.)", - ("modules", "pytz", "country_names", "CF"): "Central African Rep.", - ("modules", "pytz", "country_names", "CG"): "Congo (Rep.)", - ("modules", "pytz", "country_names", "CH"): "Switzerland", - ("modules", "pytz", "country_names", "CI"): "Côte d'Ivoire", - ("modules", "pytz", "country_names", "CK"): "Cook Islands", - ("modules", "pytz", "country_names", "CL"): "Chile", - ("modules", "pytz", "country_names", "CM"): "Cameroon", - ("modules", "pytz", "country_names", "CN"): "China", - ("modules", "pytz", "country_names", "CO"): "Colombia", - ("modules", "pytz", "country_names", "CR"): "Costa Rica", - ("modules", "pytz", "country_names", "CU"): "Cuba", - ("modules", "pytz", "country_names", "CV"): "Cape Verde", - ("modules", "pytz", "country_names", "CW"): "Curaçao", - ("modules", "pytz", "country_names", "CX"): "Christmas Island", - ("modules", "pytz", "country_names", "CY"): "Cyprus", - ("modules", "pytz", "country_names", "CZ"): "Czech Republic", - ("modules", "pytz", "country_names", "DE"): "Germany", - ("modules", "pytz", "country_names", "DJ"): "Djibouti", - ("modules", "pytz", "country_names", "DK"): "Denmark", - ("modules", "pytz", "country_names", "DM"): "Dominica", - ("modules", "pytz", "country_names", "DO"): "Dominican Republic", - ("modules", "pytz", "country_names", "DZ"): "Algeria", - ("modules", "pytz", "country_names", "EC"): "Ecuador", - ("modules", "pytz", "country_names", "EE"): "Estonia", - ("modules", "pytz", "country_names", "EG"): "Egypt", - ("modules", "pytz", "country_names", "EH"): "Western Sahara", - ("modules", "pytz", "country_names", "ER"): "Eritrea", - ("modules", "pytz", "country_names", "ES"): "Spain", - ("modules", "pytz", "country_names", "ET"): "Ethiopia", - ("modules", "pytz", "country_names", "FI"): "Finland", - ("modules", "pytz", "country_names", "FJ"): "Fiji", - ("modules", "pytz", "country_names", "FK"): "Falkland Islands", - ("modules", "pytz", "country_names", "FM"): "Micronesia", - ("modules", "pytz", "country_names", "FO"): "Faroe Islands", - ("modules", "pytz", "country_names", "FR"): "France", - ("modules", "pytz", "country_names", "GA"): "Gabon", - ("modules", "pytz", "country_names", "GB"): "Britain (UK)", - ("modules", "pytz", "country_names", "GD"): "Grenada", - ("modules", "pytz", "country_names", "GE"): "Georgia", - ("modules", "pytz", "country_names", "GF"): "French Guiana", - ("modules", "pytz", "country_names", "GG"): "Guernsey", - ("modules", "pytz", "country_names", "GH"): "Ghana", - ("modules", "pytz", "country_names", "GI"): "Gibraltar", - ("modules", "pytz", "country_names", "GL"): "Greenland", - ("modules", "pytz", "country_names", "GM"): "Gambia", - ("modules", "pytz", "country_names", "GN"): "Guinea", - ("modules", "pytz", "country_names", "GP"): "Guadeloupe", - ("modules", "pytz", "country_names", "GQ"): "Equatorial Guinea", - ("modules", "pytz", "country_names", "GR"): "Greece", - ("modules", "pytz", "country_names", "GS"): "South Georgia & the South Sandwich Islands", - ("modules", "pytz", "country_names", "GT"): "Guatemala", - ("modules", "pytz", "country_names", "GU"): "Guam", - ("modules", "pytz", "country_names", "GW"): "Guinea-Bissau", - ("modules", "pytz", "country_names", "GY"): "Guyana", - ("modules", "pytz", "country_names", "HK"): "Hong Kong", - ("modules", "pytz", "country_names", "HM"): "Heard Island & McDonald Islands", - ("modules", "pytz", "country_names", "HN"): "Honduras", - ("modules", "pytz", "country_names", "HR"): "Croatia", - ("modules", "pytz", "country_names", "HT"): "Haiti", - ("modules", "pytz", "country_names", "HU"): "Hungary", - ("modules", "pytz", "country_names", "ID"): "Indonesia", - ("modules", "pytz", "country_names", "IE"): "Ireland", - ("modules", "pytz", "country_names", "IL"): "Israel", - ("modules", "pytz", "country_names", "IM"): "Isle of Man", - ("modules", "pytz", "country_names", "IN"): "India", - ("modules", "pytz", "country_names", "IO"): "British Indian Ocean Territory", - ("modules", "pytz", "country_names", "IQ"): "Iraq", - ("modules", "pytz", "country_names", "IR"): "Iran", - ("modules", "pytz", "country_names", "IS"): "Iceland", - ("modules", "pytz", "country_names", "IT"): "Italy", - ("modules", "pytz", "country_names", "JE"): "Jersey", - ("modules", "pytz", "country_names", "JM"): "Jamaica", - ("modules", "pytz", "country_names", "JO"): "Jordan", - ("modules", "pytz", "country_names", "JP"): "Japan", - ("modules", "pytz", "country_names", "KE"): "Kenya", - ("modules", "pytz", "country_names", "KG"): "Kyrgyzstan", - ("modules", "pytz", "country_names", "KH"): "Cambodia", - ("modules", "pytz", "country_names", "KI"): "Kiribati", - ("modules", "pytz", "country_names", "KM"): "Comoros", - ("modules", "pytz", "country_names", "KN"): "St Kitts & Nevis", - ("modules", "pytz", "country_names", "KP"): "Korea (North)", - ("modules", "pytz", "country_names", "KR"): "Korea (South)", - ("modules", "pytz", "country_names", "KW"): "Kuwait", - ("modules", "pytz", "country_names", "KY"): "Cayman Islands", - ("modules", "pytz", "country_names", "KZ"): "Kazakhstan", - ("modules", "pytz", "country_names", "LA"): "Laos", - ("modules", "pytz", "country_names", "LB"): "Lebanon", - ("modules", "pytz", "country_names", "LC"): "St Lucia", - ("modules", "pytz", "country_names", "LI"): "Liechtenstein", - ("modules", "pytz", "country_names", "LK"): "Sri Lanka", - ("modules", "pytz", "country_names", "LR"): "Liberia", - ("modules", "pytz", "country_names", "LS"): "Lesotho", - ("modules", "pytz", "country_names", "LT"): "Lithuania", - ("modules", "pytz", "country_names", "LU"): "Luxembourg", - ("modules", "pytz", "country_names", "LV"): "Latvia", - ("modules", "pytz", "country_names", "LY"): "Libya", - ("modules", "pytz", "country_names", "MA"): "Morocco", - ("modules", "pytz", "country_names", "MC"): "Monaco", - ("modules", "pytz", "country_names", "MD"): "Moldova", - ("modules", "pytz", "country_names", "ME"): "Montenegro", - ("modules", "pytz", "country_names", "MF"): "St Martin (French)", - ("modules", "pytz", "country_names", "MG"): "Madagascar", - ("modules", "pytz", "country_names", "MH"): "Marshall Islands", - ("modules", "pytz", "country_names", "MK"): "North Macedonia", - ("modules", "pytz", "country_names", "ML"): "Mali", - ("modules", "pytz", "country_names", "MM"): "Myanmar (Burma)", - ("modules", "pytz", "country_names", "MN"): "Mongolia", - ("modules", "pytz", "country_names", "MO"): "Macau", - ("modules", "pytz", "country_names", "MP"): "Northern Mariana Islands", - ("modules", "pytz", "country_names", "MQ"): "Martinique", - ("modules", "pytz", "country_names", "MR"): "Mauritania", - ("modules", "pytz", "country_names", "MS"): "Montserrat", - ("modules", "pytz", "country_names", "MT"): "Malta", - ("modules", "pytz", "country_names", "MU"): "Mauritius", - ("modules", "pytz", "country_names", "MV"): "Maldives", - ("modules", "pytz", "country_names", "MW"): "Malawi", - ("modules", "pytz", "country_names", "MX"): "Mexico", - ("modules", "pytz", "country_names", "MY"): "Malaysia", - ("modules", "pytz", "country_names", "MZ"): "Mozambique", - ("modules", "pytz", "country_names", "NA"): "Namibia", - ("modules", "pytz", "country_names", "NC"): "New Caledonia", - ("modules", "pytz", "country_names", "NE"): "Niger", - ("modules", "pytz", "country_names", "NF"): "Norfolk Island", - ("modules", "pytz", "country_names", "NG"): "Nigeria", - ("modules", "pytz", "country_names", "NI"): "Nicaragua", - ("modules", "pytz", "country_names", "NL"): "Netherlands", - ("modules", "pytz", "country_names", "NO"): "Norway", - ("modules", "pytz", "country_names", "NP"): "Nepal", - ("modules", "pytz", "country_names", "NR"): "Nauru", - ("modules", "pytz", "country_names", "NU"): "Niue", - ("modules", "pytz", "country_names", "NZ"): "New Zealand", - ("modules", "pytz", "country_names", "OM"): "Oman", - ("modules", "pytz", "country_names", "PA"): "Panama", - ("modules", "pytz", "country_names", "PE"): "Peru", - ("modules", "pytz", "country_names", "PF"): "French Polynesia", - ("modules", "pytz", "country_names", "PG"): "Papua New Guinea", - ("modules", "pytz", "country_names", "PH"): "Philippines", - ("modules", "pytz", "country_names", "PK"): "Pakistan", - ("modules", "pytz", "country_names", "PL"): "Poland", - ("modules", "pytz", "country_names", "PM"): "St Pierre & Miquelon", - ("modules", "pytz", "country_names", "PN"): "Pitcairn", - ("modules", "pytz", "country_names", "PR"): "Puerto Rico", - ("modules", "pytz", "country_names", "PS"): "Palestine", - ("modules", "pytz", "country_names", "PT"): "Portugal", - ("modules", "pytz", "country_names", "PW"): "Palau", - ("modules", "pytz", "country_names", "PY"): "Paraguay", - ("modules", "pytz", "country_names", "QA"): "Qatar", - ("modules", "pytz", "country_names", "RE"): "Réunion", - ("modules", "pytz", "country_names", "RO"): "Romania", - ("modules", "pytz", "country_names", "RS"): "Serbia", - ("modules", "pytz", "country_names", "RU"): "Russia", - ("modules", "pytz", "country_names", "RW"): "Rwanda", - ("modules", "pytz", "country_names", "SA"): "Saudi Arabia", - ("modules", "pytz", "country_names", "SB"): "Solomon Islands", - ("modules", "pytz", "country_names", "SC"): "Seychelles", - ("modules", "pytz", "country_names", "SD"): "Sudan", - ("modules", "pytz", "country_names", "SE"): "Sweden", - ("modules", "pytz", "country_names", "SG"): "Singapore", - ("modules", "pytz", "country_names", "SH"): "St Helena", - ("modules", "pytz", "country_names", "SI"): "Slovenia", - ("modules", "pytz", "country_names", "SJ"): "Svalbard & Jan Mayen", - ("modules", "pytz", "country_names", "SK"): "Slovakia", - ("modules", "pytz", "country_names", "SL"): "Sierra Leone", - ("modules", "pytz", "country_names", "SM"): "San Marino", - ("modules", "pytz", "country_names", "SN"): "Senegal", - ("modules", "pytz", "country_names", "SO"): "Somalia", - ("modules", "pytz", "country_names", "SR"): "Suriname", - ("modules", "pytz", "country_names", "SS"): "South Sudan", - ("modules", "pytz", "country_names", "ST"): "Sao Tome & Principe", - ("modules", "pytz", "country_names", "SV"): "El Salvador", - ("modules", "pytz", "country_names", "SX"): "St Maarten (Dutch)", - ("modules", "pytz", "country_names", "SY"): "Syria", - ("modules", "pytz", "country_names", "SZ"): "Eswatini (Swaziland)", - ("modules", "pytz", "country_names", "TC"): "Turks & Caicos Is", - ("modules", "pytz", "country_names", "TD"): "Chad", - ("modules", "pytz", "country_names", "TF"): "French S. Terr.", - ("modules", "pytz", "country_names", "TG"): "Togo", - ("modules", "pytz", "country_names", "TH"): "Thailand", - ("modules", "pytz", "country_names", "TJ"): "Tajikistan", - ("modules", "pytz", "country_names", "TK"): "Tokelau", - ("modules", "pytz", "country_names", "TL"): "East Timor", - ("modules", "pytz", "country_names", "TM"): "Turkmenistan", - ("modules", "pytz", "country_names", "TN"): "Tunisia", - ("modules", "pytz", "country_names", "TO"): "Tonga", - ("modules", "pytz", "country_names", "TR"): "Turkey", - ("modules", "pytz", "country_names", "TT"): "Trinidad & Tobago", - ("modules", "pytz", "country_names", "TV"): "Tuvalu", - ("modules", "pytz", "country_names", "TW"): "Taiwan", - ("modules", "pytz", "country_names", "TZ"): "Tanzania", - ("modules", "pytz", "country_names", "UA"): "Ukraine", - ("modules", "pytz", "country_names", "UG"): "Uganda", - ("modules", "pytz", "country_names", "UM"): "US minor outlying islands", - ("modules", "pytz", "country_names", "US"): "United States", - ("modules", "pytz", "country_names", "UY"): "Uruguay", - ("modules", "pytz", "country_names", "UZ"): "Uzbekistan", - ("modules", "pytz", "country_names", "VA"): "Vatican City", - ("modules", "pytz", "country_names", "VC"): "St Vincent", - ("modules", "pytz", "country_names", "VE"): "Venezuela", - ("modules", "pytz", "country_names", "VG"): "Virgin Islands (UK)", - ("modules", "pytz", "country_names", "VI"): "Virgin Islands (US)", - ("modules", "pytz", "country_names", "VN"): "Vietnam", - ("modules", "pytz", "country_names", "VU"): "Vanuatu", - ("modules", "pytz", "country_names", "WF"): "Wallis & Futuna", - ("modules", "pytz", "country_names", "WS"): "Samoa (western)", - ("modules", "pytz", "country_names", "YE"): "Yemen", - ("modules", "pytz", "country_names", "YT"): "Mayotte", - ("modules", "pytz", "country_names", "ZA"): "South Africa", - ("modules", "pytz", "country_names", "ZM"): "Zambia", - ("modules", "pytz", "country_names", "ZW"): "Zimbabwe", + **PYTZ_COUNTRY_TIMEZONES, + **PYTZ_COUNTRY_NAMES, } From 2cd6b2959f2cda291d89c3f29d8fb98329513533 Mon Sep 17 00:00:00 2001 From: Kshitij Aranke Date: Mon, 9 Sep 2024 15:06:51 +0100 Subject: [PATCH 04/19] bring out model flags --- tests/unit/context/test_context.py | 90 +++++++++++------------------- 1 file changed, 32 insertions(+), 58 deletions(-) diff --git a/tests/unit/context/test_context.py b/tests/unit/context/test_context.py index bf85c0fc678..99531cc6f7e 100644 --- a/tests/unit/context/test_context.py +++ b/tests/unit/context/test_context.py @@ -291,6 +291,36 @@ def assert_has_keys(required_keys: Set[str], maybe_keys: Set[str], ctx: Dict[str for country_code, country_name in pytz.country_names.items() } +EXPECTED_MODEL_FLAGS = { + "CACHE_SELECTED_ONLY": False, + "LOG_CACHE_EVENTS": False, + "FAIL_FAST": False, + "SEND_ANONYMOUS_USAGE_STATS": True, + "LOG_PATH": "logs", + "DEBUG": False, + "WARN_ERROR": None, + "INTROSPECT": True, + "WARN_ERROR_OPTIONS": WarnErrorOptions(include=[], exclude=[]), + "QUIET": False, + "PARTIAL_PARSE": True, + "WRITE_JSON": True, + "STATIC_PARSER": True, + "USE_EXPERIMENTAL_PARSER": False, + "INVOCATION_COMMAND": "dbt unit/context/test_context.py::test_model_runtime_context", + "PRINTER_WIDTH": 80, + "VERSION_CHECK": True, + "LOG_FORMAT": "default", + "NO_PRINT": None, + "PROFILES_DIR": None, + "TARGET_PATH": None, + "EMPTY": None, + "INDIRECT_SELECTION": "eager", + "USE_COLORS": True, + "FULL_REFRESH": False, + "STORE_FAILURES": False, + "WHICH": "run", +} + EXPECTED_MODEL_CONTEXT = { ("var",): {}, ( @@ -308,35 +338,7 @@ def assert_has_keys(required_keys: Set[str], maybe_keys: Set[str], ctx: Dict[str ("log",): "", ("run_started_at",): "None", ("thread_id",): "MainThread", - ("flags",): { - "CACHE_SELECTED_ONLY": False, - "LOG_CACHE_EVENTS": False, - "FAIL_FAST": False, - "SEND_ANONYMOUS_USAGE_STATS": True, - "LOG_PATH": "logs", - "DEBUG": False, - "WARN_ERROR": None, - "INTROSPECT": True, - "WARN_ERROR_OPTIONS": WarnErrorOptions(include=[], exclude=[]), - "QUIET": False, - "PARTIAL_PARSE": True, - "WRITE_JSON": True, - "STATIC_PARSER": True, - "USE_EXPERIMENTAL_PARSER": False, - "INVOCATION_COMMAND": "dbt unit/context/test_context.py::test_model_runtime_context", - "PRINTER_WIDTH": 80, - "VERSION_CHECK": True, - "LOG_FORMAT": "default", - "NO_PRINT": None, - "PROFILES_DIR": None, - "TARGET_PATH": None, - "EMPTY": None, - "INDIRECT_SELECTION": "eager", - "USE_COLORS": True, - "FULL_REFRESH": False, - "STORE_FAILURES": False, - "WHICH": "run", - }, + ("flags",): EXPECTED_MODEL_FLAGS, ("print",): "", ("diff_of_two_dicts",): "", ("local_md5",): "", @@ -407,35 +409,7 @@ def assert_has_keys(required_keys: Set[str], maybe_keys: Set[str], ctx: Dict[str ("builtins", "log"): "", ("builtins", "run_started_at"): "None", ("builtins", "thread_id"): "MainThread", - ("builtins", "flags"): { - "CACHE_SELECTED_ONLY": False, - "LOG_CACHE_EVENTS": False, - "FAIL_FAST": False, - "SEND_ANONYMOUS_USAGE_STATS": True, - "LOG_PATH": "logs", - "DEBUG": False, - "WARN_ERROR": None, - "INTROSPECT": True, - "WARN_ERROR_OPTIONS": WarnErrorOptions(include=[], exclude=[]), - "QUIET": False, - "PARTIAL_PARSE": True, - "WRITE_JSON": True, - "STATIC_PARSER": True, - "USE_EXPERIMENTAL_PARSER": False, - "INVOCATION_COMMAND": "dbt unit/context/test_context.py::test_model_runtime_context", - "PRINTER_WIDTH": 80, - "VERSION_CHECK": True, - "LOG_FORMAT": "default", - "NO_PRINT": None, - "PROFILES_DIR": None, - "TARGET_PATH": None, - "EMPTY": None, - "INDIRECT_SELECTION": "eager", - "USE_COLORS": True, - "FULL_REFRESH": False, - "STORE_FAILURES": False, - "WHICH": "run", - }, + ("builtins", "flags"): EXPECTED_MODEL_FLAGS, ("builtins", "print"): "", ("builtins", "diff_of_two_dicts"): "", ("builtins", "local_md5"): "", From 1926c28b20cbd76c0c2241725a7bdd27de823b88 Mon Sep 17 00:00:00 2001 From: Kshitij Aranke Date: Mon, 9 Sep 2024 17:18:04 +0100 Subject: [PATCH 05/19] expand_builtins --- tests/unit/context/test_context.py | 59 ++++++++++++++++++------------ 1 file changed, 35 insertions(+), 24 deletions(-) diff --git a/tests/unit/context/test_context.py b/tests/unit/context/test_context.py index 99531cc6f7e..3e2999952ac 100644 --- a/tests/unit/context/test_context.py +++ b/tests/unit/context/test_context.py @@ -321,7 +321,15 @@ def assert_has_keys(required_keys: Set[str], maybe_keys: Set[str], ctx: Dict[str "WHICH": "run", } -EXPECTED_MODEL_CONTEXT = { + +def expand_builtins(k, v): + return { + k: v, + ("builtins", *k): v, + } + + +COMMON_CONTEXT = { ("var",): {}, ( "env_var", @@ -372,23 +380,17 @@ def assert_has_keys(required_keys: Set[str], maybe_keys: Set[str], ctx: Dict[str ("execute",): "True", ("database",): "dbt", ("schema",): "analytics", - ("adapter",): "", - ("column",): "", ("graph",): "", ("model",): "", ("pre_hooks",): "[]", ("post_hooks",): "[]", ("sql",): "", ("sql_now",): "", - ( - "adapter_macro", - ): ">", ("selected_resources",): "[]", ( "submit_python_job", ): ">", ("compiled_code",): "", - ("this",): "", ("defer_relation",): "", ("macro_a",): "", ("macro_b",): "", @@ -414,7 +416,6 @@ def assert_has_keys(required_keys: Set[str], maybe_keys: Set[str], ctx: Dict[str ("builtins", "diff_of_two_dicts"): "", ("builtins", "local_md5"): "", ("builtins", "project_name"): "root", - ("builtins", "context_macro_stack"): "", ( "builtins", "load_result", @@ -446,30 +447,18 @@ def assert_has_keys(required_keys: Set[str], maybe_keys: Set[str], ctx: Dict[str ("builtins", "ref"): "", ("builtins", "source"): "", ("builtins", "metric"): "", - ("builtins", "config"): "", - ("builtins", "execute"): "True", - ("builtins", "database"): "dbt", ("builtins", "schema"): "analytics", - ("builtins", "adapter"): "", - ("builtins", "column"): "", ("builtins", "graph"): "", ("builtins", "model"): "", ("builtins", "pre_hooks"): "[]", ("builtins", "post_hooks"): "[]", ("builtins", "sql"): "", ("builtins", "sql_now"): "", - ( - "builtins", - "adapter_macro", - ): ">", ("builtins", "selected_resources"): "[]", ( "builtins", "submit_python_job", ): ">", - ("builtins", "compiled_code"): "", - ("builtins", "this"): "", - ("builtins", "defer_relation"): "", ("target", "host"): "localhost", ("target", "port"): "1", ("target", "user"): "test", @@ -537,8 +526,6 @@ def assert_has_keys(required_keys: Set[str], maybe_keys: Set[str], ctx: Dict[str "exceptions", "warn_snapshot_timestamp_data_types", ): "", - ("api", "Relation"): "", - ("api", "Column"): "", ("root", "macro_a"): "", ("root", "macro_b"): "", ("modules", "pytz", "timezone"): "", @@ -548,7 +535,7 @@ def assert_has_keys(required_keys: Set[str], maybe_keys: Set[str], ctx: Dict[str ("modules", "pytz", "NonExistentTimeError"): "", ("modules", "pytz", "UnknownTimeZoneError"): "", ("modules", "pytz", "all_timezones"): str(pytz.all_timezones), - ("modules", "pytz", "all_timezones_set"): pytz.all_timezones_set, + ("modules", "pytz", "all_timezones_set"): set(pytz.all_timezones_set), ("modules", "pytz", "common_timezones"): str(pytz.common_timezones), ("modules", "pytz", "common_timezones_set"): set(), ("modules", "pytz", "BaseTzInfo"): "", @@ -613,6 +600,29 @@ def assert_has_keys(required_keys: Set[str], maybe_keys: Set[str], ctx: Dict[str **PYTZ_COUNTRY_NAMES, } +EXPECTED_MODEL_CONTEXT = { + **COMMON_CONTEXT, + **expand_builtins(("adapter",), ""), + **expand_builtins( + ("adapter_macro",), + ">", + ), + **expand_builtins(("column",), ""), + **expand_builtins(("this",), ""), + ("api", "Column"): "", + ("api", "Relation"): "", + ("builtins", "compiled_code"): "", + ("builtins", "config"): "", + ("builtins", "context_macro_stack"): "", + ("builtins", "database"): "dbt", + ("builtins", "defer_relation"): "", + ("builtins", "execute"): "True", +} + +EXPECTED_DOCS_RUNTIME_CONTEXT = { + **COMMON_CONTEXT, +} + def model(): return ModelNode( @@ -869,7 +879,8 @@ def test_model_runtime_context(config_postgres, manifest_fx, get_adapter, get_in def test_docs_runtime_context(config_postgres): ctx = docs.generate_runtime_docs_context(config_postgres, mock_model(), [], "root") - assert_has_keys(REQUIRED_DOCS_KEYS, MAYBE_KEYS, ctx) + actual_docs_runtime_context = {k: v for (k, v) in walk_dict(ctx)} + assert actual_docs_runtime_context == EXPECTED_DOCS_RUNTIME_CONTEXT def test_macro_namespace_duplicates(config_postgres, manifest_fx): From eeb3e247b8b6b8ddc131a9ac15a3c6f1564510fb Mon Sep 17 00:00:00 2001 From: Kshitij Aranke Date: Mon, 9 Sep 2024 17:47:40 +0100 Subject: [PATCH 06/19] expand_builtins2 --- tests/unit/context/test_context.py | 79 ++++++++++++------------------ 1 file changed, 32 insertions(+), 47 deletions(-) diff --git a/tests/unit/context/test_context.py b/tests/unit/context/test_context.py index 3e2999952ac..e1c06081647 100644 --- a/tests/unit/context/test_context.py +++ b/tests/unit/context/test_context.py @@ -322,18 +322,22 @@ def assert_has_keys(required_keys: Set[str], maybe_keys: Set[str], ctx: Dict[str } -def expand_builtins(k, v): - return { - k: v, - ("builtins", *k): v, - } +def expand_builtins(d): + o = {} + + for k, v in d.items(): + if isinstance(k, str): + o[(k,)] = v + o[("builtins", k)] = v + else: + o[k] = v + o[("builtins",) + k] = v + + return o COMMON_CONTEXT = { ("var",): {}, - ( - "env_var", - ): ">", ("return",): "", ("fromjson",): "", ("tojson",): "", @@ -352,9 +356,6 @@ def expand_builtins(k, v): ("local_md5",): "", ("project_name",): "root", ("context_macro_stack",): "", - ( - "load_result", - ): ">", ( "store_result", ): ">", @@ -370,20 +371,12 @@ def expand_builtins(k, v): ( "try_or_compiler_error", ): ">", - ( - "load_agate_table", - ): ">", ("ref",): "", ("source",): "", - ("metric",): "", ("config",): "", ("execute",): "True", ("database",): "dbt", ("schema",): "analytics", - ("graph",): "", - ("model",): "", - ("pre_hooks",): "[]", - ("post_hooks",): "[]", ("sql",): "", ("sql_now",): "", ("selected_resources",): "[]", @@ -395,10 +388,6 @@ def expand_builtins(k, v): ("macro_a",): "", ("macro_b",): "", ("builtins", "var"): {}, - ( - "builtins", - "env_var", - ): ">", ("builtins", "return"): "", ("builtins", "fromjson"): "", ("builtins", "tojson"): "", @@ -416,10 +405,6 @@ def expand_builtins(k, v): ("builtins", "diff_of_two_dicts"): "", ("builtins", "local_md5"): "", ("builtins", "project_name"): "root", - ( - "builtins", - "load_result", - ): ">", ( "builtins", "store_result", @@ -440,18 +425,9 @@ def expand_builtins(k, v): "builtins", "try_or_compiler_error", ): ">", - ( - "builtins", - "load_agate_table", - ): ">", ("builtins", "ref"): "", ("builtins", "source"): "", - ("builtins", "metric"): "", ("builtins", "schema"): "analytics", - ("builtins", "graph"): "", - ("builtins", "model"): "", - ("builtins", "pre_hooks"): "[]", - ("builtins", "post_hooks"): "[]", ("builtins", "sql"): "", ("builtins", "sql_now"): "", ("builtins", "selected_resources"): "[]", @@ -602,21 +578,30 @@ def expand_builtins(k, v): EXPECTED_MODEL_CONTEXT = { **COMMON_CONTEXT, - **expand_builtins(("adapter",), ""), **expand_builtins( - ("adapter_macro",), - ">", + { + "adapter": "", + "adapter_macro": ">", + "column": "", + "compiled_code": "", + "config": "", + "context_macro_stack": "", + "database": "dbt", + "defer_relation": "", + "env_var": ">", + "execute": "True", + "graph": "", + "load_agate_table": ">", + "load_result": ">", + "metric": "", + "model": "", + "post_hooks": "[]", + "pre_hooks": "[]", + "this": "", + } ), - **expand_builtins(("column",), ""), - **expand_builtins(("this",), ""), ("api", "Column"): "", ("api", "Relation"): "", - ("builtins", "compiled_code"): "", - ("builtins", "config"): "", - ("builtins", "context_macro_stack"): "", - ("builtins", "database"): "dbt", - ("builtins", "defer_relation"): "", - ("builtins", "execute"): "True", } EXPECTED_DOCS_RUNTIME_CONTEXT = { From e3e7e3d84409f3f7be9a30225f1498c53dbebfaa Mon Sep 17 00:00:00 2001 From: Kshitij Aranke Date: Mon, 9 Sep 2024 18:03:11 +0100 Subject: [PATCH 07/19] expand_builtins3 --- tests/unit/context/test_context.py | 72 +++++------------------------- 1 file changed, 12 insertions(+), 60 deletions(-) diff --git a/tests/unit/context/test_context.py b/tests/unit/context/test_context.py index e1c06081647..93156dd548d 100644 --- a/tests/unit/context/test_context.py +++ b/tests/unit/context/test_context.py @@ -355,36 +355,6 @@ def expand_builtins(d): ("diff_of_two_dicts",): "", ("local_md5",): "", ("project_name",): "root", - ("context_macro_stack",): "", - ( - "store_result", - ): ">", - ( - "store_raw_result", - ): ">", - ( - "write", - ): ">", - ( - "render", - ): ">", - ( - "try_or_compiler_error", - ): ">", - ("ref",): "", - ("source",): "", - ("config",): "", - ("execute",): "True", - ("database",): "dbt", - ("schema",): "analytics", - ("sql",): "", - ("sql_now",): "", - ("selected_resources",): "[]", - ( - "submit_python_job", - ): ">", - ("compiled_code",): "", - ("defer_relation",): "", ("macro_a",): "", ("macro_b",): "", ("builtins", "var"): {}, @@ -405,36 +375,6 @@ def expand_builtins(d): ("builtins", "diff_of_two_dicts"): "", ("builtins", "local_md5"): "", ("builtins", "project_name"): "root", - ( - "builtins", - "store_result", - ): ">", - ( - "builtins", - "store_raw_result", - ): ">", - ( - "builtins", - "write", - ): ">", - ( - "builtins", - "render", - ): ">", - ( - "builtins", - "try_or_compiler_error", - ): ">", - ("builtins", "ref"): "", - ("builtins", "source"): "", - ("builtins", "schema"): "analytics", - ("builtins", "sql"): "", - ("builtins", "sql_now"): "", - ("builtins", "selected_resources"): "[]", - ( - "builtins", - "submit_python_job", - ): ">", ("target", "host"): "localhost", ("target", "port"): "1", ("target", "user"): "test", @@ -597,7 +537,19 @@ def expand_builtins(d): "model": "", "post_hooks": "[]", "pre_hooks": "[]", + "ref": "", + "render": ">", + "schema": "analytics", + "selected_resources": "[]", + "source": "", + "sql": "", + "sql_now": "", + "store_raw_result": ">", + "store_result": ">", + "submit_python_job": ">", "this": "", + "try_or_compiler_error": ">", + "write": ">", } ), ("api", "Column"): "", From 76edf5569f59a51c780a7fb19ff3265e94a74d31 Mon Sep 17 00:00:00 2001 From: Kshitij Aranke Date: Mon, 9 Sep 2024 18:56:25 +0100 Subject: [PATCH 08/19] add_prefix --- tests/unit/context/test_context.py | 103 ++++++++++++++++------------- 1 file changed, 57 insertions(+), 46 deletions(-) diff --git a/tests/unit/context/test_context.py b/tests/unit/context/test_context.py index 93156dd548d..a38967cb4e1 100644 --- a/tests/unit/context/test_context.py +++ b/tests/unit/context/test_context.py @@ -322,18 +322,8 @@ def assert_has_keys(required_keys: Set[str], maybe_keys: Set[str], ctx: Dict[str } -def expand_builtins(d): - o = {} - - for k, v in d.items(): - if isinstance(k, str): - o[(k,)] = v - o[("builtins", k)] = v - else: - o[k] = v - o[("builtins",) + k] = v - - return o +def add_prefix(path_dict, prefix): + return {prefix + k: v for k, v in path_dict.items()} COMMON_CONTEXT = { @@ -516,42 +506,63 @@ def expand_builtins(d): **PYTZ_COUNTRY_NAMES, } +MODEL_BUILTINS = { + ("adapter",): "", + ( + "adapter_macro", + ): ">", + ("column",): "", + ("compiled_code",): "", + ("config",): "", + ("context_macro_stack",): "", + ("database",): "dbt", + ("defer_relation",): "", + ( + "env_var", + ): ">", + ("execute",): "True", + ("graph",): "", + ( + "load_agate_table", + ): ">", + ( + "load_result", + ): ">", + ("metric",): "", + ("model",): "", + ("post_hooks",): "[]", + ("pre_hooks",): "[]", + ("ref",): "", + ( + "render", + ): ">", + ("schema",): "analytics", + ("selected_resources",): "[]", + ("source",): "", + ("sql",): "", + ("sql_now",): "", + ( + "store_raw_result", + ): ">", + ( + "store_result", + ): ">", + ( + "submit_python_job", + ): ">", + ("this",): "", + ( + "try_or_compiler_error", + ): ">", + ( + "write", + ): ">", +} + EXPECTED_MODEL_CONTEXT = { **COMMON_CONTEXT, - **expand_builtins( - { - "adapter": "", - "adapter_macro": ">", - "column": "", - "compiled_code": "", - "config": "", - "context_macro_stack": "", - "database": "dbt", - "defer_relation": "", - "env_var": ">", - "execute": "True", - "graph": "", - "load_agate_table": ">", - "load_result": ">", - "metric": "", - "model": "", - "post_hooks": "[]", - "pre_hooks": "[]", - "ref": "", - "render": ">", - "schema": "analytics", - "selected_resources": "[]", - "source": "", - "sql": "", - "sql_now": "", - "store_raw_result": ">", - "store_result": ">", - "submit_python_job": ">", - "this": "", - "try_or_compiler_error": ">", - "write": ">", - } - ), + **MODEL_BUILTINS, + **add_prefix(MODEL_BUILTINS, ("builtins",)), ("api", "Column"): "", ("api", "Relation"): "", } From 5aaa10254d5fe962c54fddab9e128ec637ffc7fb Mon Sep 17 00:00:00 2001 From: Kshitij Aranke Date: Tue, 10 Sep 2024 11:28:13 +0100 Subject: [PATCH 09/19] get_module_exports --- tests/unit/context/test_context.py | 190 +++++++++++++---------------- 1 file changed, 86 insertions(+), 104 deletions(-) diff --git a/tests/unit/context/test_context.py b/tests/unit/context/test_context.py index a38967cb4e1..c63aeb8baeb 100644 --- a/tests/unit/context/test_context.py +++ b/tests/unit/context/test_context.py @@ -1,7 +1,8 @@ +import importlib import os import re from argparse import Namespace -from typing import Any, Dict, Mapping, Set +from typing import Any, Dict, Mapping, Optional, Set from unittest import mock import pytest @@ -322,10 +323,63 @@ def assert_has_keys(required_keys: Set[str], maybe_keys: Set[str], ctx: Dict[str } +def clean_value(value): + if isinstance(value, set): + return set(value) + elif isinstance(value, Namespace): + return value.__dict__ + elif isinstance(value, Var): + return {k: v for k, v in value._merged.items()} + else: + value_str = str(value) + value_str = re.sub(r" at 0x[0-9a-fA-F]+>", ">", value_str) + value_str = re.sub(r" id='[0-9]+'>", ">", value_str) + return value_str + + +def walk_dict(dictionary): + skip_paths = [ + ["invocation_id"], + ["builtins", "invocation_id"], + ["dbt_version"], + ["builtins", "dbt_version"], + ] + + stack = [(dictionary, [])] + visited = set() # Set to keep track of visited dictionary objects + + while stack: + current_dict, path = stack.pop(0) + + if id(current_dict) in visited: + continue + + visited.add(id(current_dict)) + + for key, value in current_dict.items(): + current_path = path + [key] + + if isinstance(value, Mapping): + stack.append((value, current_path)) + else: + if current_path not in skip_paths: + yield (tuple(current_path), clean_value(value)) + + def add_prefix(path_dict, prefix): return {prefix + k: v for k, v in path_dict.items()} +def get_module_exports(module_name: str, filter_set: Optional[Set[str]] = None): + module = importlib.import_module(module_name) + export_names = filter_set or module.__all__ + + return { + ("modules", module_name, export): clean_value(getattr(module, export)) + for export in export_names + } + + COMMON_CONTEXT = { ("var",): {}, ("return",): "", @@ -345,8 +399,6 @@ def add_prefix(path_dict, prefix): ("diff_of_two_dicts",): "", ("local_md5",): "", ("project_name",): "root", - ("macro_a",): "", - ("macro_b",): "", ("builtins", "var"): {}, ("builtins", "return"): "", ("builtins", "fromjson"): "", @@ -404,7 +456,6 @@ def add_prefix(path_dict, prefix): ("invocation_args_dict", "log_format"): "default", ("invocation_args_dict", "indirect_selection"): "eager", ("invocation_args_dict", "use_colors"): "True", - ("validation", "any"): ".validate_any>", ("exceptions", "warn"): "", ("exceptions", "missing_config"): "", ("exceptions", "missing_materialization"): "", @@ -432,8 +483,29 @@ def add_prefix(path_dict, prefix): "exceptions", "warn_snapshot_timestamp_data_types", ): "", - ("root", "macro_a"): "", - ("root", "macro_b"): "", + **get_module_exports("datetime", {"date", "datetime", "time", "timedelta", "tzinfo"}), + **get_module_exports("re"), + **get_module_exports( + "itertools", + { + "count", + "cycle", + "repeat", + "accumulate", + "chain", + "compress", + "islice", + "starmap", + "tee", + "zip_longest", + "product", + "permutations", + "combinations", + "combinations_with_replacement", + }, + ), + ("invocation_args_dict", "warn_error_options", "include"): "[]", + ("invocation_args_dict", "warn_error_options", "exclude"): "[]", ("modules", "pytz", "timezone"): "", ("modules", "pytz", "utc"): "UTC", ("modules", "pytz", "AmbiguousTimeError"): "", @@ -446,62 +518,6 @@ def add_prefix(path_dict, prefix): ("modules", "pytz", "common_timezones_set"): set(), ("modules", "pytz", "BaseTzInfo"): "", ("modules", "pytz", "FixedOffset"): "", - ("modules", "datetime", "date"): "", - ("modules", "datetime", "datetime"): "", - ("modules", "datetime", "time"): "", - ("modules", "datetime", "timedelta"): "", - ("modules", "datetime", "tzinfo"): "", - ("modules", "re", "match"): "", - ("modules", "re", "fullmatch"): "", - ("modules", "re", "search"): "", - ("modules", "re", "sub"): "", - ("modules", "re", "subn"): "", - ("modules", "re", "split"): "", - ("modules", "re", "findall"): "", - ("modules", "re", "finditer"): "", - ("modules", "re", "compile"): "", - ("modules", "re", "purge"): "", - ("modules", "re", "template"): "", - ("modules", "re", "escape"): "", - ("modules", "re", "error"): "", - ("modules", "re", "Pattern"): "", - ("modules", "re", "Match"): "", - ("modules", "re", "A"): "re.ASCII", - ("modules", "re", "I"): "re.IGNORECASE", - ("modules", "re", "L"): "re.LOCALE", - ("modules", "re", "M"): "re.MULTILINE", - ("modules", "re", "S"): "re.DOTALL", - ("modules", "re", "X"): "re.VERBOSE", - ("modules", "re", "U"): "re.UNICODE", - ("modules", "re", "ASCII"): "re.ASCII", - ("modules", "re", "IGNORECASE"): "re.IGNORECASE", - ("modules", "re", "LOCALE"): "re.LOCALE", - ("modules", "re", "MULTILINE"): "re.MULTILINE", - ("modules", "re", "DOTALL"): "re.DOTALL", - ("modules", "re", "VERBOSE"): "re.VERBOSE", - ("modules", "re", "UNICODE"): "re.UNICODE", - ("modules", "re", "NOFLAG"): "re.NOFLAG", - ("modules", "re", "RegexFlag"): "", - ("modules", "itertools", "count"): "", - ("modules", "itertools", "cycle"): "", - ("modules", "itertools", "repeat"): "", - ("modules", "itertools", "accumulate"): "", - ("modules", "itertools", "chain"): "", - ("modules", "itertools", "compress"): "", - ("modules", "itertools", "islice"): "", - ("modules", "itertools", "starmap"): "", - ("modules", "itertools", "tee"): "", - ("modules", "itertools", "zip_longest"): "", - ("modules", "itertools", "product"): "", - ("modules", "itertools", "permutations"): "", - ("modules", "itertools", "combinations"): "", - ( - "modules", - "itertools", - "combinations_with_replacement", - ): "", - ("invocation_args_dict", "warn_error_options", "include"): "[]", - ("invocation_args_dict", "warn_error_options", "exclude"): "[]", **PYTZ_COUNTRY_TIMEZONES, **PYTZ_COUNTRY_NAMES, } @@ -559,12 +575,20 @@ def add_prefix(path_dict, prefix): ): ">", } +MODEL_MACROS = { + ("macro_a",): "", + ("macro_b",): "", +} + EXPECTED_MODEL_CONTEXT = { **COMMON_CONTEXT, **MODEL_BUILTINS, **add_prefix(MODEL_BUILTINS, ("builtins",)), + **MODEL_MACROS, + **add_prefix(MODEL_MACROS, ("root",)), ("api", "Column"): "", ("api", "Relation"): "", + ("validation", "any"): ".validate_any>", } EXPECTED_DOCS_RUNTIME_CONTEXT = { @@ -773,48 +797,6 @@ def test_model_parse_context(config_postgres, manifest_fx, get_adapter, get_incl assert_has_keys(REQUIRED_MODEL_KEYS, MAYBE_KEYS, ctx) -def walk_dict(dictionary): - skip_paths = [ - ["invocation_id"], - ["builtins", "invocation_id"], - ["dbt_version"], - ["builtins", "dbt_version"], - ] - - stack = [(dictionary, [])] - visited = set() # Set to keep track of visited dictionary objects - - def clean_value(value): - if isinstance(value, set): - return set(value) - elif isinstance(value, Namespace): - return value.__dict__ - elif isinstance(value, Var): - return {k: v for k, v in value._merged.items()} - else: - value_str = str(value) - value_str = re.sub(r" at 0x[0-9a-fA-F]+>", ">", value_str) - value_str = re.sub(r" id='[0-9]+'>", ">", value_str) - return value_str - - while stack: - current_dict, path = stack.pop(0) - - if id(current_dict) in visited: - continue - - visited.add(id(current_dict)) - - for key, value in current_dict.items(): - current_path = path + [key] - - if isinstance(value, Mapping): - stack.append((value, current_path)) - else: - if current_path not in skip_paths: - yield (tuple(current_path), clean_value(value)) - - def test_model_runtime_context(config_postgres, manifest_fx, get_adapter, get_include_paths): ctx = providers.generate_runtime_model_context( model=mock_model(), From a88f0f6d691f2000f13f69718d14752f61eb4100 Mon Sep 17 00:00:00 2001 From: Kshitij Aranke Date: Tue, 10 Sep 2024 11:38:07 +0100 Subject: [PATCH 10/19] common_builtins --- tests/unit/context/test_context.py | 74 +++++++++++++----------------- 1 file changed, 32 insertions(+), 42 deletions(-) diff --git a/tests/unit/context/test_context.py b/tests/unit/context/test_context.py index c63aeb8baeb..c3eec655167 100644 --- a/tests/unit/context/test_context.py +++ b/tests/unit/context/test_context.py @@ -292,7 +292,7 @@ def assert_has_keys(required_keys: Set[str], maybe_keys: Set[str], ctx: Dict[str for country_code, country_name in pytz.country_names.items() } -EXPECTED_MODEL_FLAGS = { +COMMON_FLAGS = { "CACHE_SELECTED_ONLY": False, "LOG_CACHE_EVENTS": False, "FAIL_FAST": False, @@ -330,6 +330,8 @@ def clean_value(value): return value.__dict__ elif isinstance(value, Var): return {k: v for k, v in value._merged.items()} + elif isinstance(value, bool): + return value else: value_str = str(value) value_str = re.sub(r" at 0x[0-9a-fA-F]+>", ">", value_str) @@ -380,43 +382,31 @@ def get_module_exports(module_name: str, filter_set: Optional[Set[str]] = None): } -COMMON_CONTEXT = { - ("var",): {}, - ("return",): "", +COMMON_BUILTINS = { + ("diff_of_two_dicts",): "", + ("flags",): COMMON_FLAGS, ("fromjson",): "", - ("tojson",): "", ("fromyaml",): "", - ("toyaml",): "", + ("local_md5",): "", + ("log",): "", + ("print",): "", + ("project_name",): "root", + ("return",): "", + ("run_started_at",): "None", ("set",): "", ("set_strict",): "", + ("thread_id",): "MainThread", + ("tojson",): "", + ("toyaml",): "", + ("var",): {}, ("zip",): "", ("zip_strict",): "", - ("log",): "", - ("run_started_at",): "None", - ("thread_id",): "MainThread", - ("flags",): EXPECTED_MODEL_FLAGS, - ("print",): "", - ("diff_of_two_dicts",): "", - ("local_md5",): "", - ("project_name",): "root", - ("builtins", "var"): {}, - ("builtins", "return"): "", - ("builtins", "fromjson"): "", - ("builtins", "tojson"): "", - ("builtins", "fromyaml"): "", - ("builtins", "toyaml"): "", - ("builtins", "set"): "", - ("builtins", "set_strict"): "", - ("builtins", "zip"): "", - ("builtins", "zip_strict"): "", - ("builtins", "log"): "", - ("builtins", "run_started_at"): "None", - ("builtins", "thread_id"): "MainThread", - ("builtins", "flags"): EXPECTED_MODEL_FLAGS, - ("builtins", "print"): "", - ("builtins", "diff_of_two_dicts"): "", - ("builtins", "local_md5"): "", - ("builtins", "project_name"): "root", +} + + +COMMON_CONTEXT = { + **COMMON_BUILTINS, + **add_prefix(COMMON_BUILTINS, ("builtins",)), ("target", "host"): "localhost", ("target", "port"): "1", ("target", "user"): "test", @@ -439,23 +429,23 @@ def get_module_exports(module_name: str, filter_set: Optional[Set[str]] = None): ("target", "target_name"): "test", ("target", "profile_name"): "test", ("invocation_args_dict", "profile_dir"): "/dev/null", - ("invocation_args_dict", "cache_selected_only"): "False", - ("invocation_args_dict", "send_anonymous_usage_stats"): "True", + ("invocation_args_dict", "cache_selected_only"): False, + ("invocation_args_dict", "send_anonymous_usage_stats"): True, ("invocation_args_dict", "log_path"): "logs", - ("invocation_args_dict", "introspect"): "True", - ("invocation_args_dict", "quiet"): "False", - ("invocation_args_dict", "partial_parse"): "True", - ("invocation_args_dict", "write_json"): "True", - ("invocation_args_dict", "static_parser"): "True", + ("invocation_args_dict", "introspect"): True, + ("invocation_args_dict", "quiet"): False, + ("invocation_args_dict", "partial_parse"): True, + ("invocation_args_dict", "write_json"): True, + ("invocation_args_dict", "static_parser"): True, ( "invocation_args_dict", "invocation_command", ): "dbt unit/context/test_context.py::test_model_runtime_context", ("invocation_args_dict", "printer_width"): "80", - ("invocation_args_dict", "version_check"): "True", + ("invocation_args_dict", "version_check"): True, ("invocation_args_dict", "log_format"): "default", ("invocation_args_dict", "indirect_selection"): "eager", - ("invocation_args_dict", "use_colors"): "True", + ("invocation_args_dict", "use_colors"): True, ("exceptions", "warn"): "", ("exceptions", "missing_config"): "", ("exceptions", "missing_materialization"): "", @@ -536,7 +526,7 @@ def get_module_exports(module_name: str, filter_set: Optional[Set[str]] = None): ( "env_var", ): ">", - ("execute",): "True", + ("execute",): True, ("graph",): "", ( "load_agate_table", From d315f01c3e9d33a63d0f3802e1e26410a7ebcd46 Mon Sep 17 00:00:00 2001 From: Kshitij Aranke Date: Tue, 10 Sep 2024 11:55:48 +0100 Subject: [PATCH 11/19] COMMON_FLAGS_INVOCATION_ARGS --- tests/unit/context/test_context.py | 139 ++++++++++++++--------------- 1 file changed, 68 insertions(+), 71 deletions(-) diff --git a/tests/unit/context/test_context.py b/tests/unit/context/test_context.py index c3eec655167..3baaeb9c578 100644 --- a/tests/unit/context/test_context.py +++ b/tests/unit/context/test_context.py @@ -2,6 +2,7 @@ import os import re from argparse import Namespace +from types import NoneType from typing import Any, Dict, Mapping, Optional, Set from unittest import mock @@ -282,46 +283,6 @@ def assert_has_keys(required_keys: Set[str], maybe_keys: Set[str], ctx: Dict[str "config-version": 2, } -PYTZ_COUNTRY_TIMEZONES = { - ("modules", "pytz", "country_timezones", country_code): str(timezones) - for country_code, timezones in pytz.country_timezones.items() -} - -PYTZ_COUNTRY_NAMES = { - ("modules", "pytz", "country_names", country_code): country_name - for country_code, country_name in pytz.country_names.items() -} - -COMMON_FLAGS = { - "CACHE_SELECTED_ONLY": False, - "LOG_CACHE_EVENTS": False, - "FAIL_FAST": False, - "SEND_ANONYMOUS_USAGE_STATS": True, - "LOG_PATH": "logs", - "DEBUG": False, - "WARN_ERROR": None, - "INTROSPECT": True, - "WARN_ERROR_OPTIONS": WarnErrorOptions(include=[], exclude=[]), - "QUIET": False, - "PARTIAL_PARSE": True, - "WRITE_JSON": True, - "STATIC_PARSER": True, - "USE_EXPERIMENTAL_PARSER": False, - "INVOCATION_COMMAND": "dbt unit/context/test_context.py::test_model_runtime_context", - "PRINTER_WIDTH": 80, - "VERSION_CHECK": True, - "LOG_FORMAT": "default", - "NO_PRINT": None, - "PROFILES_DIR": None, - "TARGET_PATH": None, - "EMPTY": None, - "INDIRECT_SELECTION": "eager", - "USE_COLORS": True, - "FULL_REFRESH": False, - "STORE_FAILURES": False, - "WHICH": "run", -} - def clean_value(value): if isinstance(value, set): @@ -332,6 +293,10 @@ def clean_value(value): return {k: v for k, v in value._merged.items()} elif isinstance(value, bool): return value + elif isinstance(value, NoneType): + return None + elif isinstance(value, int): + return value else: value_str = str(value) value_str = re.sub(r" at 0x[0-9a-fA-F]+>", ">", value_str) @@ -382,6 +347,51 @@ def get_module_exports(module_name: str, filter_set: Optional[Set[str]] = None): } +PYTZ_COUNTRY_TIMEZONES = { + ("modules", "pytz", "country_timezones", country_code): str(timezones) + for country_code, timezones in pytz.country_timezones.items() +} + +PYTZ_COUNTRY_NAMES = { + ("modules", "pytz", "country_names", country_code): country_name + for country_code, country_name in pytz.country_names.items() +} + +COMMON_FLAGS_INVOCATION_ARGS = { + "CACHE_SELECTED_ONLY": False, + "LOG_FORMAT": "default", + "LOG_PATH": "logs", + "SEND_ANONYMOUS_USAGE_STATS": True, + "INDIRECT_SELECTION": "eager", + "INTROSPECT": True, + "INVOCATION_COMMAND": "dbt unit/context/test_context.py::test_model_runtime_context", + "PARTIAL_PARSE": True, + "PRINTER_WIDTH": 80, + "QUIET": False, + "STATIC_PARSER": True, + "USE_COLORS": True, + "VERSION_CHECK": True, + "WRITE_JSON": True, +} + +COMMON_FLAGS = { + **COMMON_FLAGS_INVOCATION_ARGS, + "LOG_CACHE_EVENTS": False, + "FAIL_FAST": False, + "DEBUG": False, + "WARN_ERROR": None, + "WARN_ERROR_OPTIONS": WarnErrorOptions(include=[], exclude=[]), + "USE_EXPERIMENTAL_PARSER": False, + "NO_PRINT": None, + "PROFILES_DIR": None, + "TARGET_PATH": None, + "EMPTY": None, + "FULL_REFRESH": False, + "STORE_FAILURES": False, + "WHICH": "run", +} + + COMMON_BUILTINS = { ("diff_of_two_dicts",): "", ("flags",): COMMON_FLAGS, @@ -392,7 +402,7 @@ def get_module_exports(module_name: str, filter_set: Optional[Set[str]] = None): ("print",): "", ("project_name",): "root", ("return",): "", - ("run_started_at",): "None", + ("run_started_at",): None, ("set",): "", ("set_strict",): "", ("thread_id",): "MainThread", @@ -408,44 +418,33 @@ def get_module_exports(module_name: str, filter_set: Optional[Set[str]] = None): **COMMON_BUILTINS, **add_prefix(COMMON_BUILTINS, ("builtins",)), ("target", "host"): "localhost", - ("target", "port"): "1", + ("target", "port"): 1, ("target", "user"): "test", ("target", "database"): "test", ("target", "schema"): "analytics", - ("target", "connect_timeout"): "10", - ("target", "role"): "None", - ("target", "search_path"): "None", - ("target", "keepalives_idle"): "0", - ("target", "sslmode"): "None", - ("target", "sslcert"): "None", - ("target", "sslkey"): "None", - ("target", "sslrootcert"): "None", + ("target", "connect_timeout"): 10, + ("target", "role"): None, + ("target", "search_path"): None, + ("target", "keepalives_idle"): 0, + ("target", "sslmode"): None, + ("target", "sslcert"): None, + ("target", "sslkey"): None, + ("target", "sslrootcert"): None, ("target", "application_name"): "dbt", - ("target", "retries"): "1", + ("target", "retries"): 1, ("target", "dbname"): "test", ("target", "type"): "postgres", - ("target", "threads"): "1", + ("target", "threads"): 1, ("target", "name"): "test", ("target", "target_name"): "test", ("target", "profile_name"): "test", + **add_prefix( + {(k.lower(),): v for k, v in COMMON_FLAGS_INVOCATION_ARGS.items()}, + ("invocation_args_dict",), + ), ("invocation_args_dict", "profile_dir"): "/dev/null", - ("invocation_args_dict", "cache_selected_only"): False, - ("invocation_args_dict", "send_anonymous_usage_stats"): True, - ("invocation_args_dict", "log_path"): "logs", - ("invocation_args_dict", "introspect"): True, - ("invocation_args_dict", "quiet"): False, - ("invocation_args_dict", "partial_parse"): True, - ("invocation_args_dict", "write_json"): True, - ("invocation_args_dict", "static_parser"): True, - ( - "invocation_args_dict", - "invocation_command", - ): "dbt unit/context/test_context.py::test_model_runtime_context", - ("invocation_args_dict", "printer_width"): "80", - ("invocation_args_dict", "version_check"): True, - ("invocation_args_dict", "log_format"): "default", - ("invocation_args_dict", "indirect_selection"): "eager", - ("invocation_args_dict", "use_colors"): True, + ("invocation_args_dict", "warn_error_options", "include"): "[]", + ("invocation_args_dict", "warn_error_options", "exclude"): "[]", ("exceptions", "warn"): "", ("exceptions", "missing_config"): "", ("exceptions", "missing_materialization"): "", @@ -494,8 +493,6 @@ def get_module_exports(module_name: str, filter_set: Optional[Set[str]] = None): "combinations_with_replacement", }, ), - ("invocation_args_dict", "warn_error_options", "include"): "[]", - ("invocation_args_dict", "warn_error_options", "exclude"): "[]", ("modules", "pytz", "timezone"): "", ("modules", "pytz", "utc"): "UTC", ("modules", "pytz", "AmbiguousTimeError"): "", From ce29b68d9271640063da6d94118c51c33664f875 Mon Sep 17 00:00:00 2001 From: Kshitij Aranke Date: Tue, 10 Sep 2024 14:11:19 +0100 Subject: [PATCH 12/19] get model and docs runtime tests working --- tests/unit/context/test_context.py | 135 +++++++++++++++++++---------- 1 file changed, 87 insertions(+), 48 deletions(-) diff --git a/tests/unit/context/test_context.py b/tests/unit/context/test_context.py index 3baaeb9c578..1a19f756bb7 100644 --- a/tests/unit/context/test_context.py +++ b/tests/unit/context/test_context.py @@ -2,6 +2,7 @@ import os import re from argparse import Namespace +from copy import deepcopy from types import NoneType from typing import Any, Dict, Mapping, Optional, Set from unittest import mock @@ -364,7 +365,6 @@ def get_module_exports(module_name: str, filter_set: Optional[Set[str]] = None): "SEND_ANONYMOUS_USAGE_STATS": True, "INDIRECT_SELECTION": "eager", "INTROSPECT": True, - "INVOCATION_COMMAND": "dbt unit/context/test_context.py::test_model_runtime_context", "PARTIAL_PARSE": True, "PRINTER_WIDTH": 80, "QUIET": False, @@ -438,40 +438,6 @@ def get_module_exports(module_name: str, filter_set: Optional[Set[str]] = None): ("target", "name"): "test", ("target", "target_name"): "test", ("target", "profile_name"): "test", - **add_prefix( - {(k.lower(),): v for k, v in COMMON_FLAGS_INVOCATION_ARGS.items()}, - ("invocation_args_dict",), - ), - ("invocation_args_dict", "profile_dir"): "/dev/null", - ("invocation_args_dict", "warn_error_options", "include"): "[]", - ("invocation_args_dict", "warn_error_options", "exclude"): "[]", - ("exceptions", "warn"): "", - ("exceptions", "missing_config"): "", - ("exceptions", "missing_materialization"): "", - ("exceptions", "missing_relation"): "", - ("exceptions", "raise_ambiguous_alias"): "", - ("exceptions", "raise_ambiguous_catalog_match"): "", - ("exceptions", "raise_cache_inconsistent"): "", - ("exceptions", "raise_dataclass_not_dict"): "", - ("exceptions", "raise_compiler_error"): "", - ("exceptions", "raise_database_error"): "", - ("exceptions", "raise_dep_not_found"): "", - ("exceptions", "raise_dependency_error"): "", - ("exceptions", "raise_duplicate_patch_name"): "", - ("exceptions", "raise_duplicate_resource_name"): "", - ( - "exceptions", - "raise_invalid_property_yml_version", - ): "", - ("exceptions", "raise_not_implemented"): "", - ("exceptions", "relation_wrong_type"): "", - ("exceptions", "raise_contract_error"): "", - ("exceptions", "column_type_missing"): "", - ("exceptions", "raise_fail_fast_error"): "", - ( - "exceptions", - "warn_snapshot_timestamp_data_types", - ): "", **get_module_exports("datetime", {"date", "datetime", "time", "timedelta", "tzinfo"}), **get_module_exports("re"), **get_module_exports( @@ -562,26 +528,99 @@ def get_module_exports(module_name: str, filter_set: Optional[Set[str]] = None): ): ">", } +MODEL_EXCEPTIONS = { + ("exceptions", "warn"): "", + ("exceptions", "missing_config"): "", + ("exceptions", "missing_materialization"): "", + ("exceptions", "missing_relation"): "", + ("exceptions", "raise_ambiguous_alias"): "", + ("exceptions", "raise_ambiguous_catalog_match"): "", + ("exceptions", "raise_cache_inconsistent"): "", + ("exceptions", "raise_dataclass_not_dict"): "", + ("exceptions", "raise_compiler_error"): "", + ("exceptions", "raise_database_error"): "", + ("exceptions", "raise_dep_not_found"): "", + ("exceptions", "raise_dependency_error"): "", + ("exceptions", "raise_duplicate_patch_name"): "", + ("exceptions", "raise_duplicate_resource_name"): "", + ( + "exceptions", + "raise_invalid_property_yml_version", + ): "", + ("exceptions", "raise_not_implemented"): "", + ("exceptions", "relation_wrong_type"): "", + ("exceptions", "raise_contract_error"): "", + ("exceptions", "column_type_missing"): "", + ("exceptions", "raise_fail_fast_error"): "", + ( + "exceptions", + "warn_snapshot_timestamp_data_types", + ): "", +} + MODEL_MACROS = { ("macro_a",): "", ("macro_b",): "", } -EXPECTED_MODEL_CONTEXT = { - **COMMON_CONTEXT, - **MODEL_BUILTINS, - **add_prefix(MODEL_BUILTINS, ("builtins",)), - **MODEL_MACROS, - **add_prefix(MODEL_MACROS, ("root",)), - ("api", "Column"): "", - ("api", "Relation"): "", - ("validation", "any"): ".validate_any>", -} +EXPECTED_MODEL_RUNTIME_CONTEXT = deepcopy( + { + **COMMON_CONTEXT, + **MODEL_BUILTINS, + **add_prefix(MODEL_BUILTINS, ("builtins",)), + **MODEL_MACROS, + **add_prefix(MODEL_MACROS, ("root",)), + **add_prefix( + {(k.lower(),): v for k, v in COMMON_FLAGS_INVOCATION_ARGS.items()}, + ("invocation_args_dict",), + ), + ("invocation_args_dict", "profile_dir"): "/dev/null", + ("invocation_args_dict", "warn_error_options", "include"): "[]", + ("invocation_args_dict", "warn_error_options", "exclude"): "[]", + **MODEL_EXCEPTIONS, + ("api", "Column"): "", + ("api", "Relation"): "", + ("validation", "any"): ".validate_any>", + } +) +EXPECTED_MODEL_RUNTIME_CONTEXT[("flags",)][ + "INVOCATION_COMMAND" +] = "dbt unit/context/test_context.py::test_model_runtime_context" +EXPECTED_MODEL_RUNTIME_CONTEXT[ + ( + "builtins", + "flags", + ) +]["INVOCATION_COMMAND"] = "dbt unit/context/test_context.py::test_model_runtime_context" +EXPECTED_MODEL_RUNTIME_CONTEXT[("invocation_args_dict", "invocation_command")] = ( + "dbt unit/context/test_context.py::test_model_runtime_context" +) -EXPECTED_DOCS_RUNTIME_CONTEXT = { - **COMMON_CONTEXT, +DOCS_BUILTINS = { + ("doc",): ">", + ("env_var",): ">", } +EXPECTED_DOCS_RUNTIME_CONTEXT = deepcopy( + { + **COMMON_CONTEXT, + **DOCS_BUILTINS, + **add_prefix(DOCS_BUILTINS, ("builtins",)), + } +) + +EXPECTED_DOCS_RUNTIME_CONTEXT[("flags",)][ + "INVOCATION_COMMAND" +] = "dbt unit/context/test_context.py::test_docs_runtime_context" +EXPECTED_DOCS_RUNTIME_CONTEXT[ + ( + "builtins", + "flags", + ) +]["INVOCATION_COMMAND"] = "dbt unit/context/test_context.py::test_docs_runtime_context" + def model(): return ModelNode( @@ -791,7 +830,7 @@ def test_model_runtime_context(config_postgres, manifest_fx, get_adapter, get_in manifest=manifest_fx, ) actual_model_context = {k: v for (k, v) in walk_dict(ctx)} - assert actual_model_context == EXPECTED_MODEL_CONTEXT + assert actual_model_context == EXPECTED_MODEL_RUNTIME_CONTEXT def test_docs_runtime_context(config_postgres): From ebb587602e6b5bc5ea6701d768d13cd45e9c8d6e Mon Sep 17 00:00:00 2001 From: Kshitij Aranke Date: Tue, 10 Sep 2024 14:18:28 +0100 Subject: [PATCH 13/19] remove typing.NoneType --- tests/unit/context/test_context.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/unit/context/test_context.py b/tests/unit/context/test_context.py index 1a19f756bb7..daf68b04cd4 100644 --- a/tests/unit/context/test_context.py +++ b/tests/unit/context/test_context.py @@ -3,7 +3,6 @@ import re from argparse import Namespace from copy import deepcopy -from types import NoneType from typing import Any, Dict, Mapping, Optional, Set from unittest import mock @@ -294,7 +293,7 @@ def clean_value(value): return {k: v for k, v in value._merged.items()} elif isinstance(value, bool): return value - elif isinstance(value, NoneType): + elif value is None: return None elif isinstance(value, int): return value @@ -820,7 +819,8 @@ def test_model_parse_context(config_postgres, manifest_fx, get_adapter, get_incl manifest=manifest_fx, context_config=mock.MagicMock(), ) - assert_has_keys(REQUIRED_MODEL_KEYS, MAYBE_KEYS, ctx) + actual_model_context = {k: v for (k, v) in walk_dict(ctx)} + assert actual_model_context == EXPECTED_MODEL_RUNTIME_CONTEXT def test_model_runtime_context(config_postgres, manifest_fx, get_adapter, get_include_paths): From 231b61f51c2b2935172649f0d5313fa0656806cc Mon Sep 17 00:00:00 2001 From: Kshitij Aranke Date: Tue, 10 Sep 2024 15:34:44 +0100 Subject: [PATCH 14/19] test: leaf_contexts_set --- tests/unit/context/test_context.py | 34 +++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/tests/unit/context/test_context.py b/tests/unit/context/test_context.py index daf68b04cd4..e7bb1355017 100644 --- a/tests/unit/context/test_context.py +++ b/tests/unit/context/test_context.py @@ -14,7 +14,12 @@ from dbt.clients.jinja import MacroStack from dbt.config.project import VarProvider from dbt.context import base, docs, macros, providers, query_header -from dbt.context.base import Var +from dbt.context.base import BaseContext, Var +from dbt.context.configured import MacroResolvingContext +from dbt.context.docs import DocsRuntimeContext +from dbt.context.providers import MacroContext, TestContext, UnitTestContext +from dbt.context.query_header import QueryHeaderContext +from dbt.context.secret import SecretContext from dbt.contracts.files import FileHash from dbt.contracts.graph.nodes import ( DependsOn, @@ -347,6 +352,16 @@ def get_module_exports(module_name: str, filter_set: Optional[Set[str]] = None): } +def get_leaf_subclasses(cls): + leaf_subclasses = set() + for subclass in cls.__subclasses__(): + if not subclass.__subclasses__(): + leaf_subclasses.add(subclass) + else: + leaf_subclasses.update(get_leaf_subclasses(subclass)) + return frozenset(leaf_subclasses) + + PYTZ_COUNTRY_TIMEZONES = { ("modules", "pytz", "country_timezones", country_code): str(timezones) for country_code, timezones in pytz.country_timezones.items() @@ -620,6 +635,18 @@ def get_module_exports(module_name: str, filter_set: Optional[Set[str]] = None): ) ]["INVOCATION_COMMAND"] = "dbt unit/context/test_context.py::test_docs_runtime_context" +EXPECTED_LEAF_CONTEXTS = frozenset( + { + SecretContext, + QueryHeaderContext, + MacroResolvingContext, + MacroContext, + UnitTestContext, + TestContext, + DocsRuntimeContext, + } +) + def model(): return ModelNode( @@ -774,6 +801,11 @@ def postgres_adapter(config_postgres, get_adapter): clear_plugin(postgres.Plugin) +def test_leaf_contexts_set(): + contexts = get_leaf_subclasses(BaseContext) + assert contexts == EXPECTED_LEAF_CONTEXTS + + def test_query_header_context(config_postgres, manifest_fx): ctx = query_header.generate_query_header_context( config=config_postgres, From b8d1f635a68f44b976b774c9fdb44a25694c4dbc Mon Sep 17 00:00:00 2001 From: Kshitij Aranke Date: Tue, 10 Sep 2024 16:48:39 +0100 Subject: [PATCH 15/19] rm: INVOCATION_COMMAND --- tests/unit/context/test_context.py | 36 ++++++++---------------------- 1 file changed, 9 insertions(+), 27 deletions(-) diff --git a/tests/unit/context/test_context.py b/tests/unit/context/test_context.py index e7bb1355017..309b67b8676 100644 --- a/tests/unit/context/test_context.py +++ b/tests/unit/context/test_context.py @@ -315,6 +315,7 @@ def walk_dict(dictionary): ["builtins", "invocation_id"], ["dbt_version"], ["builtins", "dbt_version"], + ["invocation_args_dict", "invocation_command"], ] stack = [(dictionary, [])] @@ -335,7 +336,11 @@ def walk_dict(dictionary): stack.append((value, current_path)) else: if current_path not in skip_paths: - yield (tuple(current_path), clean_value(value)) + cv = clean_value(value) + if current_path == ["flags"]: + del cv["INVOCATION_COMMAND"] + + yield (tuple(current_path), cv) def add_prefix(path_dict, prefix): @@ -427,8 +432,7 @@ def get_leaf_subclasses(cls): ("zip_strict",): "", } - -COMMON_CONTEXT = { +COMMON_RUNTIME_CONTEXT = { **COMMON_BUILTINS, **add_prefix(COMMON_BUILTINS, ("builtins",)), ("target", "host"): "localhost", @@ -579,7 +583,7 @@ def get_leaf_subclasses(cls): EXPECTED_MODEL_RUNTIME_CONTEXT = deepcopy( { - **COMMON_CONTEXT, + **COMMON_RUNTIME_CONTEXT, **MODEL_BUILTINS, **add_prefix(MODEL_BUILTINS, ("builtins",)), **MODEL_MACROS, @@ -597,18 +601,6 @@ def get_leaf_subclasses(cls): ("validation", "any"): ".validate_any>", } ) -EXPECTED_MODEL_RUNTIME_CONTEXT[("flags",)][ - "INVOCATION_COMMAND" -] = "dbt unit/context/test_context.py::test_model_runtime_context" -EXPECTED_MODEL_RUNTIME_CONTEXT[ - ( - "builtins", - "flags", - ) -]["INVOCATION_COMMAND"] = "dbt unit/context/test_context.py::test_model_runtime_context" -EXPECTED_MODEL_RUNTIME_CONTEXT[("invocation_args_dict", "invocation_command")] = ( - "dbt unit/context/test_context.py::test_model_runtime_context" -) DOCS_BUILTINS = { ("doc",): " Date: Tue, 10 Sep 2024 16:51:49 +0100 Subject: [PATCH 16/19] rm: leaf --- tests/unit/context/test_context.py | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/tests/unit/context/test_context.py b/tests/unit/context/test_context.py index 309b67b8676..7d831d0c4b4 100644 --- a/tests/unit/context/test_context.py +++ b/tests/unit/context/test_context.py @@ -14,7 +14,7 @@ from dbt.clients.jinja import MacroStack from dbt.config.project import VarProvider from dbt.context import base, docs, macros, providers, query_header -from dbt.context.base import BaseContext, Var +from dbt.context.base import Var from dbt.context.configured import MacroResolvingContext from dbt.context.docs import DocsRuntimeContext from dbt.context.providers import MacroContext, TestContext, UnitTestContext @@ -357,16 +357,6 @@ def get_module_exports(module_name: str, filter_set: Optional[Set[str]] = None): } -def get_leaf_subclasses(cls): - leaf_subclasses = set() - for subclass in cls.__subclasses__(): - if not subclass.__subclasses__(): - leaf_subclasses.add(subclass) - else: - leaf_subclasses.update(get_leaf_subclasses(subclass)) - return frozenset(leaf_subclasses) - - PYTZ_COUNTRY_TIMEZONES = { ("modules", "pytz", "country_timezones", country_code): str(timezones) for country_code, timezones in pytz.country_timezones.items() @@ -783,11 +773,6 @@ def postgres_adapter(config_postgres, get_adapter): clear_plugin(postgres.Plugin) -def test_leaf_contexts_set(): - contexts = get_leaf_subclasses(BaseContext) - assert contexts == EXPECTED_LEAF_CONTEXTS - - def test_query_header_context(config_postgres, manifest_fx): ctx = query_header.generate_query_header_context( config=config_postgres, From fc6c58c98b9a14a7417ebbd4d58b6061dce7b757 Mon Sep 17 00:00:00 2001 From: Kshitij Aranke Date: Tue, 10 Sep 2024 16:57:51 +0100 Subject: [PATCH 17/19] rm: run_started_at, selected_resources --- tests/unit/context/test_context.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/unit/context/test_context.py b/tests/unit/context/test_context.py index 7d831d0c4b4..50cdcfd784f 100644 --- a/tests/unit/context/test_context.py +++ b/tests/unit/context/test_context.py @@ -316,6 +316,10 @@ def walk_dict(dictionary): ["dbt_version"], ["builtins", "dbt_version"], ["invocation_args_dict", "invocation_command"], + ["run_started_at"], + ["builtins", "run_started_at"], + ["selected_resources"], + ["builtins", "selected_resources"], ] stack = [(dictionary, [])] From f2215ef5116e52ad211506b5f3360432310f6ece Mon Sep 17 00:00:00 2001 From: Kshitij Aranke Date: Tue, 10 Sep 2024 17:05:47 +0100 Subject: [PATCH 18/19] rm: run_started_at, selected_resources --- tests/unit/context/test_context.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/unit/context/test_context.py b/tests/unit/context/test_context.py index 50cdcfd784f..f2fbe84d29e 100644 --- a/tests/unit/context/test_context.py +++ b/tests/unit/context/test_context.py @@ -415,7 +415,6 @@ def get_module_exports(module_name: str, filter_set: Optional[Set[str]] = None): ("print",): "", ("project_name",): "root", ("return",): "", - ("run_started_at",): None, ("set",): "", ("set_strict",): "", ("thread_id",): "MainThread", @@ -518,7 +517,6 @@ def get_module_exports(module_name: str, filter_set: Optional[Set[str]] = None): "render", ): ">", ("schema",): "analytics", - ("selected_resources",): "[]", ("source",): "", ("sql",): "", ("sql_now",): "", From 423ffe75174fc7165fbf143163b93936202c538b Mon Sep 17 00:00:00 2001 From: Kshitij Aranke Date: Wed, 11 Sep 2024 12:47:48 +0100 Subject: [PATCH 19/19] Add runtime prefix --- tests/unit/context/test_context.py | 46 ++++++++++++++++++------------ 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/tests/unit/context/test_context.py b/tests/unit/context/test_context.py index f2fbe84d29e..0c4de211a09 100644 --- a/tests/unit/context/test_context.py +++ b/tests/unit/context/test_context.py @@ -15,11 +15,6 @@ from dbt.config.project import VarProvider from dbt.context import base, docs, macros, providers, query_header from dbt.context.base import Var -from dbt.context.configured import MacroResolvingContext -from dbt.context.docs import DocsRuntimeContext -from dbt.context.providers import MacroContext, TestContext, UnitTestContext -from dbt.context.query_header import QueryHeaderContext -from dbt.context.secret import SecretContext from dbt.contracts.files import FileHash from dbt.contracts.graph.nodes import ( DependsOn, @@ -538,6 +533,10 @@ def get_module_exports(module_name: str, filter_set: Optional[Set[str]] = None): ): ">", } +MODEL_RUNTIME_BUILTINS = { + **MODEL_BUILTINS, +} + MODEL_EXCEPTIONS = { ("exceptions", "warn"): "", ("exceptions", "missing_config"): "", @@ -576,8 +575,29 @@ def get_module_exports(module_name: str, filter_set: Optional[Set[str]] = None): EXPECTED_MODEL_RUNTIME_CONTEXT = deepcopy( { **COMMON_RUNTIME_CONTEXT, - **MODEL_BUILTINS, - **add_prefix(MODEL_BUILTINS, ("builtins",)), + **MODEL_RUNTIME_BUILTINS, + **add_prefix(MODEL_RUNTIME_BUILTINS, ("builtins",)), + **MODEL_MACROS, + **add_prefix(MODEL_MACROS, ("root",)), + **add_prefix( + {(k.lower(),): v for k, v in COMMON_FLAGS_INVOCATION_ARGS.items()}, + ("invocation_args_dict",), + ), + ("invocation_args_dict", "profile_dir"): "/dev/null", + ("invocation_args_dict", "warn_error_options", "include"): "[]", + ("invocation_args_dict", "warn_error_options", "exclude"): "[]", + **MODEL_EXCEPTIONS, + ("api", "Column"): "", + ("api", "Relation"): "", + ("validation", "any"): ".validate_any>", + } +) + +EXPECTED_MODEL_RUNTIME_CONTEXT = deepcopy( + { + **COMMON_RUNTIME_CONTEXT, + **MODEL_RUNTIME_BUILTINS, + **add_prefix(MODEL_RUNTIME_BUILTINS, ("builtins",)), **MODEL_MACROS, **add_prefix(MODEL_MACROS, ("root",)), **add_prefix( @@ -609,18 +629,6 @@ def get_module_exports(module_name: str, filter_set: Optional[Set[str]] = None): } ) -EXPECTED_LEAF_CONTEXTS = frozenset( - { - SecretContext, - QueryHeaderContext, - MacroResolvingContext, - MacroContext, - UnitTestContext, - TestContext, - DocsRuntimeContext, - } -) - def model(): return ModelNode(