Skip to content

Conversation

@Ajay9704
Copy link

@Ajay9704 Ajay9704 commented Jan 7, 2026

Summary

This PR resolves issue #60185 where BaseSensorOperator wasn't clickable in provider documentation, making it hard to find information about sensor parameters.

The Problem

I discovered that BaseSensorOperator lives in the new Task SDK at airflow/task-sdk/src/airflow/sdk/bases/sensor.py, but when building documentation for providers, the system only scanned the current provider's source code. This meant that when providers like the standard sensors referenced BaseSensorOperator, the documentation couldn't create proper links to the actual class definition.

My Approach

I modified airflow/devel-common/src/docs/provider_conf.py to:

  • Add the task-sdk source path to the autoapi directories so provider docs can access SDK classes
  • Set up proper intersphinx mapping to link to task-sdk documentation
  • Include safeguards to prevent any conflicts between documentation sources

Impact

This change means users can now click on BaseSensorOperator references in provider documentation and jump directly to the class definition to see all available parameters and methods. Much more user-friendly

@Ajay9704
Copy link
Author

Ajay9704 commented Jan 7, 2026

@uranusjr @phanikumv Thanks for the reviews! I've addressed the feedback:

  1. Removed the unnecessary try-except block around the airflow.sdk import since task-sdk must be available when building docs for providers that use BaseSensorOperator
  2. Removed the empty code block with just a pass statement that wasn't doing anything

The changes now cleanly add:
Task-sdk source path to autoapi_dirs so provider documentation can find SDK classes
Intersphinx mapping to enable proper cross-referencing to task-sdk documentation

This should resolve the issue where BaseSensorOperator wasn't clickable in provider documentation, making sensor parameters easier to discover. Thanks again for the feedback!

@Ajay9704 Ajay9704 requested review from phanikumv and uranusjr January 7, 2026 10:44
@potiuk
Copy link
Member

potiuk commented Jan 7, 2026

Can you please show docs generated by it with clickable classes ? (screenshot)

@potiuk potiuk added the full tests needed We need to run full set of tests for this PR to merge label Jan 7, 2026
@potiuk potiuk force-pushed the basesensoroperator-params-doc-60185 branch from c6a5ef0 to eeae301 Compare January 7, 2026 13:04
@potiuk
Copy link
Member

potiuk commented Jan 7, 2026

I also rebased it and added "full tests needed" just in case.

@potiuk
Copy link
Member

potiuk commented Jan 7, 2026

Some mypy issue to fix @Ajay9704

@Ajay9704
Copy link
Author

Ajay9704 commented Jan 8, 2026

@potiuk Sir , sorry for troubling you , but unfortunately my changes didn't worked for static checks ,
this is my code
-intersphinx_mapping["task-sdk"] = (f"https://airflow.apache.org/docs/task-sdk/{task_sdk_version}/", (f"https://airflow.apache.org/docs/task-sdk/{task_sdk_version}/objects.inv",))
..........................................................................
and pre-commit hooks chnaged this to
..............................................................................
intersphinx_mapping["task-sdk"] = (
f"https://airflow.apache.org/docs/task-sdk/{task_sdk_version}/",
(f"https://airflow.apache.org/docs/task-sdk/{task_sdk_version}/objects.inv",),
)
I was unaware about this before and i apologise for the mistake and now , i have changed that part so now it should also pass static checks , so please if you don't mind re-approve to run all checks again , and if it passes then i can get the screenshots from the docs generated that you asked for from there , please do me this help sir

@phanikumv
Copy link
Contributor

@potiuk Sir , sorry for troubling you , but unfortunately my changes didn't worked for static checks , this is my code -intersphinx_mapping["task-sdk"] = (f"https://airflow.apache.org/docs/task-sdk/{task_sdk_version}/", (f"https://airflow.apache.org/docs/task-sdk/{task_sdk_version}/objects.inv",)) .......................................................................... and pre-commit hooks chnaged this to .............................................................................. intersphinx_mapping["task-sdk"] = ( f"https://airflow.apache.org/docs/task-sdk/{task_sdk_version}/", (f"https://airflow.apache.org/docs/task-sdk/{task_sdk_version}/objects.inv",), ) I was unaware about this before and i apologise for the mistake and now , i have changed that part so now it should also pass static checks , so please if you don't mind re-approve to run all checks again , and if it passes then i can get the screenshots from the docs generated that you asked for from there , please do me this help sir

I have approved the workflows to run now

@Ajay9704
Copy link
Author

Ajay9704 commented Jan 8, 2026

@phanikumv ,Thanks for your patience. I realized that i had missed placing an import at the top of the file earlier, which caused the static check failure. I’ve fixed the import order now and cleaned up the code accordingly.

Could you please re-run the checks when you get a chance?

Thanks a lot for your review and guidance.

@phanikumv
Copy link
Contributor

@phanikumv ,Thanks for your patience. I realized that i had missed placing an import at the top of the file earlier, which caused the static check failure. I’ve fixed the import order now and cleaned up the code accordingly.

Could you please re-run the checks when you get a chance?

Thanks a lot for your review and guidance.

done, triggered the re-run

@Ajay9704
Copy link
Author

Ajay9704 commented Jan 8, 2026

Hi @potiuk Sir,
I’ve addressed all the issues that were actionable from my side and updated the code accordingly.
Regarding the screenshots you asked for, i am currently unable to generate them locally because the documentation build hasn’t completed successfully yet ,from what all i can see, there doesn’t seem to be anything further I can fix on my end to unblock the docs build.
Could you please advise on how I should proceed here? Is there an alternative way to verify or demonstrate the clickable links, or anything else that you like me to try?

@potiuk , @phanikumv thank you very much for your patience and for helping by re-triggering the checks so far

@potiuk
Copy link
Member

potiuk commented Jan 8, 2026

Could you please advise on how I should proceed here? Is there an alternative way to verify or demonstrate the clickable links, or anything else that you like me to try?

hard to say - but this is part of the task to figure out how to make the build succeed, I suggest you try to run it locally - following contributing guide, build it for one provider, look at the errors and try to fix it.

@eladkal eladkal force-pushed the basesensoroperator-params-doc-60185 branch from 5439427 to 41143dd Compare January 13, 2026 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full tests needed We need to run full set of tests for this PR to merge kind:documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants