<p dir="auto"><strong>Apache Airflow version</strong>: 1.10.12</p>
<p dir="auto"><strong>Environment</strong>:</p>
<ul dir="auto">
<li><strong>OS</strong> (e.g. from /etc/os-release): Any OS: Mac OS, Linux</li>
<li><strong>Install tools</strong>: Pipenv</li>
<li><strong>Others</strong>:</li>
</ul>
<p dir="auto"><strong>What happened</strong>:</p>
<p dir="auto">Trying to lock pip dependencies with pipenv is not working, I'm 90% sure because Apache Airflow specifies <code class="notranslate">attrs</code> package dependency at "~=19.3" somewhere in the project. Here's the error message:<br>
<code class="notranslate">ERROR: ERROR: Could not find a version that matches attrs&gt;=17.3.0,&gt;=17.4.0,&gt;=20.1.0,~=19.3 Tried: 15.0.0, 15.0.0, 15.1.0, 15.1.0, 15.2.0, 15.2.0, 16.0.0, 16.0.0, 16.1.0, 16.1.0, 16.2.0, 16.2.0, 16.3.0, 16.3.0, 17.1.0, 17.1.0, 17.2.0, 17.2.0, 17.3.0, 17.3.0, 17.4.0, 17.4.0, 18.1.0, 18.1.0, 18.2.0, 18.2.0, 19.1.0, 19.1.0, 19.2.0, 19.2.0, 19.3.0, 19.3.0, 20.1.0, 20.1.0, 20.2.0, 20.2.0</code></p>
<p dir="auto"><strong>What you expected to happen</strong>:</p>
<p dir="auto">Pipenv dependencies lock without errors</p>
<p dir="auto"><strong>How to reproduce it</strong>:<br>
Try to add <code class="notranslate">apache-airflow = {extras = ["postgres", "redis", "s3", "ssh", "crypto", "kubernetes"],version = "==1.10.12"}</code> to Pipfile and run <code class="notranslate">pipenv install</code></p>
<p dir="auto"><strong>Anything else we need to know</strong>:<br>
Here's how <code class="notranslate">pipenv graph</code> lists apache-airflow dependencies:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="apache-airflow==1.10.12
  ...
  - attrs [required: ~=19.3, installed: 19.3.0]
  - cached-property [required: ~=1.5, installed: 1.5.2]"><pre class="notranslate"><code class="notranslate">apache-airflow==1.10.12
  ...
  - attrs [required: ~=19.3, installed: 19.3.0]
  - cached-property [required: ~=1.5, installed: 1.5.2]
</code></pre></div>
<p dir="auto">Whereas in setup.py file, <a href="https://github.com/apache/airflow/blob/master/setup.py">https://github.com/apache/airflow/blob/master/setup.py</a>, attrs are locked at 'attrs&gt;=20.0, &lt;21.0'.</p>
<p dir="auto"><strong>Question</strong>:<br>
I know it might pipenv-related question, but did you pin <code class="notranslate">attrs</code> package version at 19.3 anywhere in the project? And do you have any idea on how can I alter the version number so that pipenv stops complaining</p>
<p dir="auto">In fact, I face quite a lot of issues with pipenv due to Airflow subdependencies. Is it a known issue that Airflow is not working well with Pipenv?</p>
<h3 dir="auto">Apache Airflow version</h3>
<p dir="auto">2.2.0 (latest released)</p>
<h3 dir="auto">Operating System</h3>
<p dir="auto">Ubuntu 20.04.3 LTS</p>
<h3 dir="auto">Versions of Apache Airflow Providers</h3>
<p dir="auto">apache-airflow-providers-oracle==2.0.1<br>
apache-airflow-providers-ssh==2.1.1</p>
<h3 dir="auto">Deployment</h3>
<p dir="auto">Virtualenv installation</p>
<h3 dir="auto">Deployment details</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">What happened</h3>
<p dir="auto">During the the command <code class="notranslate">airflow db upgrade</code> we got this error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[2021-10-12 06:25:10,721] {db.py:815} ERROR - Automatic migration is not available
[2021-10-12 06:25:10,721] {db.py:817} ERROR - The task_instance table has 1392 rows without a corresponding dag_run row. You must manually correct this problem (possibly by deleting the problem rows)."><pre class="notranslate"><code class="notranslate">[2021-10-12 06:25:10,721] {db.py:815} ERROR - Automatic migration is not available
[2021-10-12 06:25:10,721] {db.py:817} ERROR - The task_instance table has 1392 rows without a corresponding dag_run row. You must manually correct this problem (possibly by deleting the problem rows).
</code></pre></div>
<h3 dir="auto">What you expected to happen</h3>
<p dir="auto">It would be nice if the output of <code class="notranslate">airflow db upgrade</code> is the list of objects' ID that needs to be deleted, in order to preserve future's version consistency.</p>
<p dir="auto">Or even better the SQL statement to manually remove them.</p>
<p dir="auto">I tried to identify those rows but it is not a trivial task.</p>
<h3 dir="auto">How to reproduce</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Anything else</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Are you willing to submit PR?</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Yes I am willing to submit a PR!</li>
</ul>
<h3 dir="auto">Code of Conduct</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I agree to follow this project's <a href="https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md">Code of Conduct</a></li>
</ul>