Issue 1:
Apache Airflow version

6f8c204

Environment

OS (e.g. from /etc/os-release): Mac OS 11.3

Kernel: Darwin Kernel Version 20.4.0

Install tools: pip install -e .

What happened:

Tried to import valid connection json via the cli. Got an error:

❯ echo '{"sqlite_conn_id": {
"conn_type": "sqlite",
"description": "",
"host": "localhost",
"login": "",
"password": null,
"schema": "/usr/local/airflow/test.db",
"port": null,
"extra": ""
}}' | jq . > connections.json

❯ airflow connections import connections.json
Traceback (most recent call last):
File "/Users/matt/src/airflow/venv/bin/airflow", line 33, in <module>
sys.exit(load_entry_point('apache-airflow', 'console_scripts', 'airflow')())
File "/Users/matt/src/airflow/airflow/__main__.py", line 40, in main
args.func(args)
File "/Users/matt/src/airflow/airflow/cli/cli_parser.py", line 48, in command
return func(*args, **kwargs)
File "/Users/matt/src/airflow/airflow/utils/cli.py", line 91, in wrapper
return f(*args, **kwargs)
File "/Users/matt/src/airflow/airflow/cli/commands/connection_command.py", line 244, in connections_import
_import_helper(args.file)
File "/Users/matt/src/airflow/airflow/cli/commands/connection_command.py", line 272, in _import_helper
key: value for key, value in conn_values.items() if key in allowed_fields
AttributeError: 'Connection' object has no attribute 'items'

Several of the tests assume that load_connections_dict returns a dict of dicts

airflow/tests/cli/commands/test_connection_command.py

Line 790
in
6f8c204

# We're not testing the behavior of load_connections_dict, assume successfully reads JSON, YAML or env

Actually, load_connections_dict returns a dict of Connections

airflow/airflow/secrets/local_filesystem.py

Line 278
in
6f8c204

connection_by_conn_id[key] = _create_connection(key, secret_values)

When we call .items() on the Connection, it fails.

What you expected to happen:

The import is sucessful.

How to reproduce it:

See commands above.

Anything else we need to know:

This commit fixes it (I think): MatrixManAtYrService@5159059

I started making a PR, but while trying to make the tests pass I started to worry that I was on the wrong path, so I made an issue instead.

Issue 2:
Apache Airflow version: 1.10.10

Environment:

Cloud provider or hardware configuration:

OS (e.g. from /etc/os-release): centos 7.5

Kernel (e.g. uname -a):Linux prod-auto-ops001 3.10.0-1062.4.1.el7.x86_64 #1 SMP Fri Oct 18 17:15:30 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Install tools: pip

Others:

What happened:

I have two environments, one is development, another is production. They uses CeleryExecutor and redis for broker, mysql for result backend and the airflow db. The only difference is production env got two worker.

I passed the params, max_active_runs in my dag defination , eg:

dag = DAG(
dag_id='test_max_active_runs',
default_args=default_args,
schedule_interval=None,
start_date=airflow.utils.dates.days_ago(1),
max_active_runs=1
)

In the dev env, when the task is scheduled, the dashboard will show 1/1 active dag runs in red color, while nothing happens in the production env.

May I suppose that the setting max_active_runs is not working in my production env?

What you expected to happen:

It should be exactly the same in the production env comparison to the dev env.

How to reproduce it:

Let me know if you need further information