Issue 1:
Description

One of the main things we want to know is task durations.

The main way I know how to get this is to hover over the Gannt chart or use the Task Duration chart.

It would be nice to have the data that is in the Gannt chart or the Task Duration chat in a table view.

Use case/motivation

That plots are making the data harder to find than a table alone.

Related issues

No response

Are you willing to submit a PR?

Yes I am willing to submit a PR!

Code of Conduct

I agree to follow this project's Code of Conduct

Issue 2:
Describe the issue with documentation

In response to the contents of https://airflow.apache.org/docs/apache-airflow/stable/tutorial.html#testing as of 2021-10-13

There are several broken things in the tutorial as given, and a few pieces of missing context. (I can help PR this once I go through the contributor guidelines; just recording them for now).

In order:

Table Definitions

In initial setup, there is a name collision in the employees_temp: both tables use a constraint named employees_pk. The latter (_temp) should probably use employees_temp_pk.

(As a nit-pick, it feels odd to capitalize the table names, requires quoting the names when using psql's \d.)

Python Code

Imports

Firstly, it's missing necessary imports. Perhaps they're obvious if you're experienced with airflow, but for those coming into fresh it's not clear what's missing. It appears to be:

from airflow.decorators import dag, task
from airflow.hooks.postgres_hook import PostgresHook
from datetime import datetime, timedelta
import requests

Connections

There's no mention of 'connections' (or the concept) in the documentation leading up to this tutorial. The code as written relies on an airflow Connection named LOCAL being defined.

Paths and Duplicated Code

The path where the file is downloaded is hard-coded to /usr/local/airflow/.... For those following https://airflow.apache.org/docs/apache-airflow/stable/start/docker.html this would likely need to be /opt/airflow/dags/files, and require the files subdirectory to be created first.

Regardless, it would be nice if this path were defined once at the top of the script or as a parameter or other config option rather than copy-pasted.

Bugs

cur.copy_from references file handle with variable f but the handle's name is file.

copy_from does not handle a CSV header row. We either need to skip the first line, or use copy_expert or similar:

cur.copy_expert("COPY \"Employees_temp\" FROM stdin WITH CSV HEADER DELIMITER AS ','", file)

Location

It says 'save the file' but doesn't specify whether there's any naming convention or somesuch. I might suggest providing an example name like etl.py.

Data

The data this script relies on comes from https://raw.githubusercontent.com/apache/airflow/main/docs/apache-airflow/pipeline_example.csv .

It appears this file is a spreadsheet export; the 'Serial Numbercolumn's data is in scientific notation format. This is resulting in some truncation and duplicate keys (e.g.9.78938E+12` appears 25 times).

Secondly, the data at this URL appears to use linefeed (LF,\n) for newlines. The postgres 'copy' documentation says this should work fine.

The python code itself before attempting the copy_from splits the input on newline; effectively removing all newlines from the file. Seems we should remove the 'split' and just write the contents directly, or have it file.write(row+'\n')

Lastly, there's a blank newline at the end of the written file; this doesn't work for postgres copy from

How to solve the problem

Just to re-itemize from the above:

include all necessary imports in the example

move the saved file path to a variable or config with notes to modify it to meet the current system's requirements

include a note on Connections and note that one needs to be set up as appropriate (either one named LOCAL or the user should create one and modify the code here to use it). This may be a bigger concern for those following the [docker start](https://airflow.apache.org/docs/apache-airflow/stable/start/docker.html

avoid duplicate primary key constraint names in the table definitions

retain newlines when writing CSV file and remove blank lines

correct variable names (file instead of f)

properly handle CSV header row

use long number format rather than scientific notation

Anything else

No response

Are you willing to submit PR?

Yes I am willing to submit a PR!

Code of Conduct

I agree to follow this project's Code of Conduct