To move an entire Apache Airflow codebase off a deprecated function or module onto its replacement without missing a caller, Atlas leverages its `lsp` tool to enumerate every callsite, creates `todowrite` entries for tracking, and applies changes with `apply_patch`. This ensures a complete migration, validated by `pytest (DagBag)` and formatted by `ruff format`.
How Atlas Enumerates Deprecated API Callsites in Apache Airflow
In 2026, migrating a deprecated API across an Apache Airflow codebase begins with a precise enumeration of every callsite. Atlas uses its `lsp` tool's `findReferences` operation to identify all usages of the deprecated symbol, ensuring no caller is missed across DAG definitions or custom operators.
Atlas provides a robust method for identifying every instance of a deprecated API within your Apache Airflow project. It starts by employing the `lsp` tool's `findReferences` operation, which leverages the language server protocol to yield a complete set of callers for a given symbol. This is crucial for Airflow projects, where deprecated functions might appear in DAG definitions within the `dags/` folder, custom operators, or task dependencies. To catch dynamic or string-based usages that `lsp` might miss, Atlas cross-checks the initial enumeration with its `grep` tool. This dual approach guarantees a comprehensive list of all callsites. Once identified, Atlas automatically creates a `todowrite` entry for each callsite, making partial progress visible and ensuring no migration task is silently overlooked.
Migrating Apache Airflow Code with Context-Anchored Patches
Migrating each deprecated API callsite in Apache Airflow requires precise, context-aware changes to prevent errors. Atlas employs its `apply_patch` tool, which seeks the hunk's context and `old_lines` to ensure edits are applied correctly, failing explicitly rather than misapplying to a drifted file. This prevents 100% of silent misapplications.
After enumerating all deprecated API callsites, Atlas proceeds with the actual code migration using its `apply_patch` tool. This tool is designed for safety and precision, applying changes as context-anchored patches. Instead of guessing, `apply_patch` actively seeks the specific context and `old_lines` of the code hunk it intends to modify. If the expected lines are not found due to file drift or other discrepancies, the patch operation fails with a 'Failed to find expected lines' error. This mechanism is vital for maintaining the integrity of complex Apache Airflow code, such as changes within DAG definitions or custom operators. Atlas drafts a plan in a read-only plan agent and asks for approval before switching to a build agent to execute these changes, ensuring developer oversight at every step. Each successful migration marks its corresponding `todowrite` entry as complete, providing clear progress tracking.
Validating Apache Airflow Migrations with `pytest (DagBag)` and `ruff format`
After each file modification in an Apache Airflow migration, Atlas immediately validates the changes by running affected tests. It uses the `bash` tool to execute `pytest (DagBag)`, ensuring DAGs parse correctly and tasks function as expected. This immediate feedback loop prevents regressions and confirms the migration's integrity 100% of the time.
Ensuring the correctness of migrated Apache Airflow code is paramount. Atlas integrates directly with your existing Airflow toolchain to validate changes. After `apply_patch` modifies a file, Atlas uses its `bash` tool to run `uv run pytest (DagBag)`. This command executes your project's tests, specifically leveraging `DagBag` to ensure that DAG objects are parsed correctly and that task dependencies and logic remain sound. Only once these tests pass is the `todowrite` entry for that specific callsite marked as completed. Furthermore, Atlas can execute `ruff format` via `bash` on the modified files, ensuring that code style is consistently maintained across the Apache Airflow codebase. Every Atlas tool call, including `bash` commands, is permission-gated, requiring explicit `allow` or `ask` rules before execution, providing an additional layer of safety.
Ensuring Safety and Review in Apache Airflow API Migrations
Atlas prioritizes safety and developer review throughout the Apache Airflow API migration process. Every Atlas tool call is permission-gated, requiring explicit `allow` or `ask` rules before execution. Atlas also computes a unified diff for every file edit, presenting it for approval before writing, ensuring 0 unexpected changes.
Safety and developer control are core tenets of Atlas's approach to Apache Airflow API migrations. Before any tool, such as `lsp`, `grep`, `todowrite`, `apply_patch`, or `bash`, is executed, Atlas checks against permission-gated `allow`, `ask`, or `deny` rules. This ensures that no action is taken without explicit consent. When Atlas proposes a code change, it first drafts a plan in a read-only agent, allowing you to review the strategy. Once approved, it switches to a build agent. For every file edit, Atlas computes a unified diff and surfaces it for your approval before writing to disk. This transparent process guarantees that you see and approve every single change, preventing any unintended modifications to your Apache Airflow DAGs or custom operators. Atlas also reads git branches, status, and diffs, and can stage and create commits on your behalf, streamlining the version control aspect of the migration. File changes are snapshotted as git patches, providing an easy rollback mechanism if needed.
Finalizing and Confirming Deprecated API Removal in Apache Airflow
To finalize a deprecated API migration in Apache Airflow, Atlas performs a comprehensive sweep to confirm zero remaining usages. After all `todowrite` entries are completed and tests pass, Atlas uses `grep` to search the entire codebase for the deprecated symbol, ensuring a clean removal. This final check guarantees 100% eradication.
The final stage of migrating a deprecated API in Apache Airflow with Atlas involves a rigorous confirmation of its complete removal. Once all individual callsites have been migrated, their `todowrite` entries marked complete, and all associated tests (run via `pytest (DagBag)`) have passed, Atlas performs a final verification. It uses its `grep` tool to search the entire codebase for any remaining instances of the deprecated symbol. This ensures that no dynamic or obscure usages were missed during the initial enumeration or subsequent migration steps. Only when this final `grep` yields zero hits is the deprecated API considered fully eradicated. Atlas can then assist in deleting the old implementation, ensuring a clean and maintainable Apache Airflow codebase. Atlas's ability to read git status and create commits on your behalf simplifies the process of finalizing and committing the entire migration, including updates to your `pyproject.toml` pinning `apache-airflow`.
Step by step
- 01Enumerate all deprecated API callsites using `atlas lsp findReferences <deprecated_symbol>` and `atlas grep <deprecated_symbol>` across your Apache Airflow `dags/` folder and custom operators.
- 02Create a `todowrite` entry for each identified callsite to track progress, for example: `atlas todowrite add "Migrate <file_path>:<line_number>"`.
- 03Apply context-anchored patches to migrate each callsite using `atlas apply_patch`, ensuring the patch context and `old_lines` match the target code.
- 04After each file modification, run `atlas bash "uv run pytest (DagBag)"` to execute your Apache Airflow tests and confirm DAG parsing and functionality.
- 05Ensure code style consistency by running `atlas bash "ruff format <file_path>"` on modified files, then review and approve the unified diff presented by Atlas.
- 06Mark the `todowrite` entry as completed only after the tests pass and the diff is approved.
- 07Once all `todowrite` entries are complete, run `atlas grep <deprecated_symbol>` one final time to confirm zero remaining hits in your Apache Airflow codebase.
- 08Use Atlas to remove the deprecated function or module implementation, then stage and create a commit for the entire migration, referencing your `pyproject.toml`.
Frequently asked questions
- How does Atlas ensure it finds *all* deprecated API calls in Apache Airflow?
- Atlas combines `lsp`'s `findReferences` for precise symbol lookup with `grep` for dynamic or string-based usages, ensuring a complete enumeration across Apache Airflow DAGs, task dependencies, and custom operators.
- What prevents Atlas from making incorrect changes to my Apache Airflow code?
- Atlas's `apply_patch` tool uses context-anchored patches that explicitly fail if the expected `old_lines` are not found, preventing misapplications to drifted Apache Airflow files. All changes are also presented as a unified diff for approval before writing.
- How does Atlas integrate with Apache Airflow's testing workflow?
- Atlas uses its `bash` tool to run `uv run pytest (DagBag)` after each file modification, validating that Apache Airflow DAGs parse correctly and tasks function as expected before marking a `todowrite` entry complete.
- Can Atlas help maintain code style during an Apache Airflow migration?
- Yes, Atlas can execute `ruff format` via its `bash` tool on modified files, ensuring that all changes adhere to your Apache Airflow project's established code style guidelines and `pyproject.toml` configurations.
- How does Atlas handle large-scale migrations across many Apache Airflow files?
- Atlas creates individual `todowrite` entries for each callsite, allowing partial progress visibility. It can also fan out work to subagents for parallel processing, making large Apache Airflow migrations across numerous DAGs manageable.
- What if I need to roll back changes made by Atlas in my Apache Airflow repository?
- Atlas snapshots file changes as git patches, allowing edits to be easily diffed and rolled back. It also integrates with git to stage and create commits on your behalf, providing clear history and control over your Apache Airflow repository.
- Does Atlas require my Apache Airflow code to be sent to a third-party server?
- No, Atlas can build its code index with local Ollama embeddings, keeping your Apache Airflow code entirely off third-party servers and ensuring data privacy and security for your DAG definitions and sensitive configurations.
Try Atlas in your terminal
The terminal-native AI coding agent. Free core, single binary.
Install AtlasRelated guides
Migrate a Deprecated API Across Every Callsite with Atlas (2026 Workflow)
How to migrate a deprecated API across every callsite with Atlas in 2026: the lsp tool's findReferences enumerates callers, todowrite tracks them, apply_patch migrates each one.
Document an Apache Airflow Module with a README in 2026 using Atlas
For Apache Airflow developers in 2026, Atlas generates accurate READMEs for modules by analyzing live code, ensuring documentation reflects current behavior, not outdated plans. It integrates with `pytest (DagBag)` and
Diagnose a Hanging or Long-Running Command in Apache Airflow with Atlas in 2026
In 2026, use Atlas to diagnose and resolve hanging or slow Apache Airflow commands. Identify interactive input blocks or genuinely slow scripts within your DAGs and unblock them efficiently.
Review a pull request in Apache Airflow with Atlas in 2026
Streamline Apache Airflow pull request reviews in 2026 with Atlas. Catch subtle bugs in DAG definitions, task dependencies, and top-level code using AI-powered context and real Airflow tools.
Extract a Shared Helper from Duplicated Code in Apache Airflow with Atlas in 2026
Streamline your Apache Airflow DAGs in 2026 by extracting duplicated logic into a shared, tested helper using Atlas. Find semantic duplicates, create new modules, and apply changes with confidence.
Automate GitHub Issue and Pull Request Triage in Apache Airflow with Atlas in 2026
Automate GitHub issue and pull request triage in Apache Airflow with Atlas. Safely respond to events, enforce trusted users, and integrate with your dags/ and pyproject.toml setup. Atlas leverages pytest (DagBag) and
Trace a runtime bug from a stack trace in Apache Airflow with Atlas in 2026
Pinpoint and fix runtime bugs in Apache Airflow DAGs using Atlas, the terminal-native AI coding agent. Go from a production stack trace to a precise fix without a debugger attached.
Refactor a Legacy Module in Apache Airflow with Atlas in 2026
Streamline Apache Airflow DAGs and tasks by refactoring legacy Python modules with Atlas. Safely restructure code, verify behavior with pytest (DagBag), and ensure no breaking changes in 2026.