amoghrajesh commented on code in PR #40588:
URL: https://github.com/apache/airflow/pull/40588#discussion_r1664459336
##########
docs/build_docs.py:
##########
@@ -450,6 +450,14 @@ def main():
for pkg in sorted(available_packages):
console.print(f" - {pkg}")
+ for package in available_packages:
+ api_dir = os.path.join(DOCS_DIR, package, "_api")
+ if os.path.exists(api_dir):
+ console.print(
+ f"[red] The toctree already contains a reference to a
nonexisting document for provider [green]'{package}'[/green]. Please use the
--clean-build option"
Review Comment:
```suggestion
f"[red]The toctree already contains a reference to a
non-existing document for provider [green]'{package}'[/green]. Use the
--clean-build option while building docs"
```
##########
docs/build_docs.py:
##########
@@ -450,6 +450,14 @@ def main():
for pkg in sorted(available_packages):
console.print(f" - {pkg}")
+ for package in available_packages:
+ api_dir = os.path.join(DOCS_DIR, package, "_api")
+ if os.path.exists(api_dir):
Review Comment:
I think we can print a general warning if the `_api` folder is present, but
if its actually empty, that's where the real problem lies.
So something like this should be better:
```
if os.path.exists(api_dir):
if not os.listdir(api_dir):
console.print(
f"[red] The toctree already contains a reference to a
nonexisting document for provider [green]'{package}'[/green]. Please use the
--clean-build option"
)
else:
// we are ok here, a general warning is good enough. In fact no
warning is also ok
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]