**Apache Airflow version**: 2.0.1


**Kubernetes version (if you are using kubernetes)** (use `kubectl version`): No

**Environment**:

- **Cloud provider or hardware configuration**: local machine
- **OS** (e.g. from /etc/os-release): 18.04.5 LTS (Bionic Beaver)
- **Kernel** (e.g. `uname -a`): wsl2

**What happened**:
Getting Pickled_id: None

```
root@12c7fd58e084:/opt/airflow# airflow tasks run example_bash_operator runme_0 now --ship-dag --interactive
[2021-05-09 13:11:33,247] {dagbag.py:487} INFO - Filling up the DagBag from /files/dags
Running <TaskInstance: example_bash_operator.runme_0 2021-05-09T13:11:31.788923+00:00 [None]> on host 12c7fd58e084
Pickled dag <DAG: example_bash_operator> as pickle_id: None
Sending to executor.
[2021-05-09 13:11:34,722] {base_executor.py:82} INFO - Adding to queue: ['airflow', 'tasks', 'run', 'example_bash_operator', 'runme_0', '2021-05-09T13:11:31.788923+00:00', '--local', '--pool', 'default_pool', '--subdir', '/opt/airflow/airflow/example_dags/example_bash_operator.py']
[2021-05-09 13:11:34,756] {local_executor.py:81} INFO - QueuedLocalWorker running ['airflow', 'tasks', 'run', 'example_bash_operator', 'runme_0', '2021-05-09T13:11:31.788923+00:00', '--local', '--pool', 'default_pool', '--subdir', '/opt/airflow/airflow/example_dags/example_bash_operator.py']
[2021-05-09 13:11:34,757] {local_executor.py:386} INFO - Shutting down LocalExecutor; waiting for running tasks to finish.  Signal again if you don't want to wait.
[2021-05-09 13:11:34,817] {dagbag.py:487} INFO - Filling up the DagBag from /opt/airflow/airflow/example_dags/example_bash_operator.py
Running <TaskInstance: example_bash_operator.runme_0 2021-05-09T13:11:31.788923+00:00 [None]> on host 12c7fd58e084
```

**What you expected to happen**:

Pickled_id should get generated 

```
Pickled dag <DAG: example_bash_operator> as pickle_id: None
```

**How to reproduce it**:
run below command from command line in airflow environment
```
airflow tasks run example_bash_operator runme_0 now --ship-dag --interactive
```
**Would like to submit PR for this issue**: YES


airflow/cli/commands/task_command.py
"""Tests task for a given dag_id"""
    
    
    
    settings.MASK_SECRETS_IN_LOGS = True
    handlers = logging.getLogger('airflow.task').handlers
    already_has_stream_handler = False
    for handler in handlers:
        already_has_stream_handler = isinstance(handler, logging.StreamHandler)
        if already_has_stream_handler:
            break
    if not already_has_stream_handler:
        logging.getLogger('airflow.task').propagate = True
    env_vars = {'AIRFLOW_TEST_MODE': 'True'}
    if args.env_vars:
        env_vars.update(args.env_vars)
        os.environ.update(env_vars)
    dag = dag or get_dag(args.subdir, args.dag_id)
    task = dag.get_task(task_id=args.task_id)
    
    if args.task_params:
        passed_in_params = json.loads(args.task_params)
        task.params.update(passed_in_params)
    ti = _get_ti(task, args.execution_date_or_run_id)
    try:
        if args.dry_run:
            ti.dry_run()
        else:
            ti.run(ignore_task_deps=True, ignore_ti_state=True, test_mode=True)
    except Exception: