我一直在尝试使用 pip 安装命令在我的计算机上安装 apache airflow。我在虚拟环境中成功安装了airflow。当我尝试运行“airflow Standalone”或“airflow db migrate”时,它一直给我一个错误提示
File "/usr/local/bin/airflow", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.10/site-packages/airflow/__main__.py", line 57, in main
args.func(args)
File "/usr/local/lib/python3.10/site-packages/airflow/cli/cli_config.py", line 49, in command
return func(*args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/airflow/cli/commands/standalone_command.py", line 53, in entrypoint
StandaloneCommand().run()
File "/usr/local/lib/python3.10/site-packages/airflow/utils/providers_configuration_loader.py", line 54, in wrapped_function
ProvidersManager().initialize_providers_configuration()
File "/usr/local/lib/python3.10/site-packages/airflow/providers_manager.py", line 376, in wrapped_function
func(*args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/airflow/providers_manager.py", line 555, in initialize_providers_configuration
self._initialize_providers_configuration()
File "/usr/local/lib/python3.10/site-packages/airflow/providers_manager.py", line 568, in _initialize_providers_configuration
self.initialize_providers_list()
File "/usr/local/lib/python3.10/site-packages/airflow/providers_manager.py", line 376, in wrapped_function
func(*args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/airflow/providers_manager.py", line 483, in initialize_providers_list
self._discover_all_providers_from_packages()
File "/usr/local/lib/python3.10/site-packages/airflow/providers_manager.py", line 604, in _discover_all_providers_from_packages
self._provider_schema_validator.validate(provider_info)
File "/usr/local/lib/python3.10/site-packages/jsonschema/validators.py", line 435, in validate
raise error
jsonschema.exceptions.ValidationError: Additional properties are not allowed ('class-names' was unexpected)
Failed validating 'additionalProperties' in schema['properties']['triggers']['items']:
{'additionalProperties': False,
'properties': {'integration-name': {'description': 'Integration name. '
'It must have a '
'matching item in '
"the 'integration' "
'section of any '
'provider.',
'type': 'string'},
'python-modules': {'description': 'List of Python '
'modules containing '
'the triggers.',
'items': {'type': 'string'},
'type': 'array'}},
'required': ['integration-name', 'python-modules'],
'type': 'object'}
On instance['triggers'][0]:
{'class-names': ['airflow.providers.google.cloud.triggers.bigquery_dts.BigQueryDataTransferRunTrigger'],
'integration-name': 'Google BigQuery Data Transfer Service'}
我尝试使用“气流独立”运行气流,希望气流能够启动您,但我遇到了错误。
这是一个迟到的回复,但这是 apache-airflow-providers-google 的一些问题。
如果您在本地运行气流,而不是在 Google Cloud 中,则最好的选择是删除与
pip uninstall apache-airflow-providers-google
的集成。否则,请更新它,它可以在最新版本中正常使用pip install --upgrade apache-airflow-providers-google
。