apache / airflow

Apache Airflow - A platform to programmatically author, schedule, and monitor workflows
https://airflow.apache.org/
Apache License 2.0
37.29k stars 14.34k forks source link

Airflow doesn't support DAGs that start with a number in their name #872

Closed criccomini closed 8 years ago

criccomini commented 8 years ago

I had a DAG with a name that started with a number. The UI in Airflow broke. It was unable to show me any of the status circle SVGs for the DAG, even though it had been executed successfully, and within the last hour. I believe the issue is JS/jQuery related.

The JS error that I see is:

Uncaught SyntaxError: Failed to execute 'querySelector' on 'Document': 'svg#123-report' is not a valid selector.

The code that triggers this exception is:

        g = d3.select('svg#' + dag_id)
          .attr('height', diameter + (stroke_width_hover * 2))
          .attr('width', '180px')
          .selectAll("g")
          .data(states)
          .enter()
          .append('g')
          .attr('transform', function(d, i) {
            x = (i * (diameter + circle_margin)) + (diameter/2 + circle_margin);
            y = (diameter/2) + stroke_width_hover;
            return 'translate(' + x + ',' + y + ')';
          });

I googled around a bit, and it looks like jQuery doesn't support selectors that start with numbers:

http://stackoverflow.com/questions/23898873/failed-to-execute-queryselectorall-on-document-how-to-fix

(first answer)

Not sure what the fix is for this, but it isn't too user friendly to have DAGs not work in the UI.

criccomini commented 8 years ago

(this is on 1.6.2)

r39132 commented 8 years ago

@criccomini Can you close this? It should be fixed.

Also, refer to @mistercrunch's question about use-cases for naming dags starting with a digit in the referenced PR #944

We (Agari) don't have such a use-case.