Add docstrings to tracer.py and several utils functions#2687
Open
mastash3ff wants to merge 1 commit intosimonw:mainfrom
Open
Add docstrings to tracer.py and several utils functions#2687mastash3ff wants to merge 1 commit intosimonw:mainfrom
mastash3ff wants to merge 1 commit intosimonw:mainfrom
Conversation
Document get_task_id, trace_child_tasks, trace, capture_traces, and AsgiTracer in tracer.py, and get_outbound_foreign_keys, get_all_foreign_keys, detect_spatialite, filters_should_redirect, format_bytes, and escape_fts in utils/__init__.py. No logic changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds Python docstrings to a handful of public functions and classes that were previously undocumented. No logic, behaviour, or tests are changed.
datasette/tracer.pyget_task_id— explains the context-variable fallback and why child tasks share the parent's IDtrace_child_tasks— describes how it pins the parent task ID for child task attributiontrace— documents the no-op path, the yielded dict, and the reserved-key constraintcapture_traces— documents the list argument and de-registration on exitAsgiTracerclass — describes the?_trace=1injection behaviour and the body-size guarddatasette/utils/__init__.pyget_outbound_foreign_keys— notes the compound-key exclusionget_all_foreign_keys— shows the returned dict shape and sort guaranteedetect_spatialite— explains thegeometry_columnsheuristicfilters_should_redirect— documents the legacy-to-compact parameter conversion and theNone-value sentinelformat_bytes— describes the unit-step logicescape_fts— clarifies the quoting strategy and the unbalanced-quote fixTest plan
ruff check datasette/tracer.py datasette/utils/__init__.pypasses (verified locally)📚 Documentation preview 📚: https://datasette--2687.org.readthedocs.build/en/2687/