repo
stringclasses
454 values
file_path
stringlengths
5
201
extension
stringclasses
1 value
content
stringlengths
8
509k
num_lines
int64
3
16.9k
size_bytes
int64
8
511k
dagster
python_modules/automation/automation_tests/dagster_docs_tests/test_watch_commands.py
.py
"""Tests for dagster-docs watch commands.""" from automation.dagster_docs.commands.watch import watch from click.testing import CliRunner class TestWatchCommands: """Test suite for watch commands.""" def setup_method(self): """Set up test fixtures.""" self.runner = CliRunner() def test_...
60
2,437
dagster
python_modules/automation/automation_tests/dagster_docs_tests/test_known_valid_symbols.py
.py
"""Tests for symbols that are known to have valid docstrings. This test suite validates all public symbols from the dagster package to ensure they have valid docstrings that render correctly in the documentation build. These tests serve as comprehensive regression tests to ensure the validator doesn't produce false p...
269
12,354
dagster
python_modules/automation/automation_tests/dagster_docs_tests/test_helper_functions.py
.py
"""Tests for helper functions in docs CLI commands.""" from pathlib import Path from unittest.mock import Mock, patch import pytest from automation.dagster_docs.commands.check import ( _find_git_root, _validate_changed_files, _validate_package_symbols, _validate_single_symbol, ) from automation.dagste...
142
5,680
dagster
python_modules/automation/automation_tests/dagster_docs_tests/test_integration.py
.py
"""Integration tests for dagster-docs CLI.""" import pytest from automation.dagster_docs.main import main from click.testing import CliRunner class TestMainCLIIntegration: """Integration tests for the main CLI entry point.""" def setup_method(self): """Set up test fixtures.""" self.runner = ...
193
7,138
dagster
python_modules/automation/automation_tests/dagster_docs_tests/test_method_docstrings.py
.py
"""Tests for method docstring validation focusing on parameter handling.""" from automation.dagster_docs.validator import validate_docstring_text from dagster._annotations import public class TestMethodDocstringValidation: """Test that method docstrings are validated correctly and self/cls parameters are handled...
352
12,634
dagster
python_modules/automation/automation_tests/dagster_docs_tests/test_python_ast_rule.py
.py
"""Comprehensive tests for Python AST validation in docstrings.""" import pytest from automation.dagster_docs.docstring_rules.base import ValidationContext, ValidationResult from automation.dagster_docs.docstring_rules.python_ast_rule import ( _extract_python_code_blocks, _validate_python_syntax, create_py...
808
24,060
dagster
python_modules/automation/automation_tests/dagster_docs_tests/test_ls_commands.py
.py
"""Tests for dagster-docs ls commands.""" from automation.dagster_docs.commands.ls import ls from click.testing import CliRunner class TestLsCommands: """Test suite for ls commands.""" def setup_method(self): """Set up test fixtures.""" self.runner = CliRunner() def test_ls_symbols_with...
78
3,096
dagster
python_modules/automation/automation_tests/dagster_docs_tests/test_path_converters.py
.py
"""Tests for path converter functions.""" from pathlib import Path from automation.dagster_docs.path_converters import ( dagster_path_converter, generic_path_converter, simple_package_converter, ) class TestDagsterPathConverter: def test_core_dagster_module(self): root = Path("/dagster") ...
183
5,624
dagster
python_modules/automation/automation_tests/dagster_docs_tests/test_public_methods.py
.py
"""Tests for validating @public methods on @public classes.""" import pytest from automation.dagster_docs.validator import SymbolImporter class TestPublicMethodFiltering: """Test that only @public methods on @public classes are identified for validation.""" def test_identifies_only_public_methods_on_public_...
173
7,734
dagster
python_modules/automation/automation_tests/dagster_docs_tests/test_discover_section_headers.py
.py
"""Discover all section headers currently used in the Dagster codebase. This test scans all public symbols to find section headers (lines ending with ':') and reports which ones are not in our current whitelist. """ # Get the actual docstring from collections import Counter from automation.dagster_docs.docstring_rul...
108
4,231
dagster
python_modules/automation/automation_tests/dagster_docs_tests/test_exclude_lists_audit.py
.py
"""Tests for the exclude-lists audit functionality.""" from unittest.mock import Mock, patch from automation.dagster_docs.commands.check import ( _audit_exclude_missing_export, _audit_exclude_missing_public, _audit_exclude_missing_rst, check, ) from automation.dagster_docs.public_api_validator import ...
395
16,914
dagster
python_modules/automation/automation_tests/dagster_docs_tests/test_public_api_validator.py
.py
"""Tests for public API validation utilities.""" from pathlib import Path import pytest from automation.dagster_docs.exclude_lists import ( EXCLUDE_MISSING_EXPORT, EXCLUDE_MISSING_PUBLIC, EXCLUDE_MISSING_RST, EXCLUDE_MODULES_FROM_PUBLIC_SCAN, EXCLUDE_RST_FILES, ) from automation.dagster_docs.publi...
355
14,805
dagster
python_modules/automation/automation_tests/dagster_docs_tests/test_validator.py
.py
"""Tests for the docstring validator core functionality.""" from automation.dagster_docs.validator import ( ValidationResult, validate_docstring_text, validate_symbol_docstring, ) class TestValidationResult: """Test ValidationResult record functionality.""" def test_create_validation_result(self...
259
9,837
dagster
python_modules/automation/automation_tests/dagster_docs_tests/test_check_commands.py
.py
"""Tests for dagster-docs check commands.""" from pathlib import Path from unittest.mock import patch from automation.dagster_docs.commands.check import check from click.testing import CliRunner class TestCheckDocstringsCommands: """Test suite for check docstrings commands.""" def setup_method(self): ...
374
17,159
dagster
python_modules/automation/automation_tests/dagster_docs_tests/test_public_symbol_utils.py
.py
"""Tests for public symbol utility functions.""" from automation.dagster_docs.public_symbol_utils import ( get_public_methods_from_class, is_valid_public_method, ) from dagster._annotations import public class TestIsValidPublicMethod: """Test the is_valid_public_method function.""" def test_regular_...
344
10,187
dagster
python_modules/automation/automation_tests/dagster_docs_tests/test_enhanced_section_headers.py
.py
"""Tests for enhanced section header error detection and messaging. This test module validates the improved error detection and messaging for malformed section headers in docstrings, ensuring that users get clear, actionable feedback about common formatting mistakes. """ from automation.dagster_docs.validator import ...
472
17,739
dagster
python_modules/automation/automation_tests/dagster_docs_tests/test_fixtures/test_public_class.py
.py
"""Test fixtures for @public method validation. This module contains test classes with various combinations of public and non-public methods to verify that the docstring validator correctly identifies only @public methods on @public classes. """ from dagster._annotations import public @public class PublicClass: ...
82
2,498
dagster
python_modules/automation/automation_tests/dagster_dev_tests/test_bk_latest_build_for_pr.py
.py
"""Integration tests for bk-latest-build-for-pr command.""" import json from unittest.mock import Mock, patch from click.testing import CliRunner def test_bk_latest_build_for_pr_integration(): """Integration test against real PR 31774 which should return build 131689.""" # Mock the subprocess calls to simul...
135
4,678
dagster
python_modules/automation/automation_tests/dagster_dev_tests/test_bk_build_status.py
.py
"""Integration tests for bk-build-status command.""" import json import os from unittest.mock import Mock, patch from click.testing import CliRunner def create_mock_buildkite_response(jobs): """Create a mock Buildkite API response.""" return {"jobs": jobs} def create_mock_job(name, state, job_id=None): ...
224
9,619
dagster
python_modules/automation/automation_tests/dagster_dev_tests/ai_review_tests/test_ai_review_summarize_smoke.py
.py
"""Simple smoke tests for ai-review-summarize command.""" from unittest.mock import patch from automation.dagster_dev.commands.diff_summarizer import ChangeType, SmartDiffSummary from click.testing import CliRunner class TestAiReviewSummarizeSmoke: """Basic smoke tests for the ai-review-summarize command.""" ...
151
5,666
dagster
python_modules/automation/automation_tests/dagster_dev_tests/ai_review_tests/test_ai_review_cache_smoke.py
.py
"""Simple smoke tests for ai-review-cache command.""" from unittest.mock import Mock, patch from click.testing import CliRunner class TestAiReviewCacheSmoke: """Basic smoke tests for the ai-review-cache command.""" def test_import_and_basic_structure(self): """Test that command can be imported and ...
109
3,948
dagster
python_modules/automation/automation_tests/dagster_dev_tests/ai_review_tests/test_ai_review_analyze.py
.py
"""Simple smoke tests for ai-review-analyze command.""" from click.testing import CliRunner class TestAiReviewAnalyze: """Basic smoke tests for the ai-review-analyze command.""" def test_import_and_basic_structure(self): """Test that command can be imported and has expected structure.""" fro...
48
1,782
dagster
python_modules/automation/automation_tests/dagster_dev_tests/ai_review_tests/test_ai_review_summarize.py
.py
"""Simple smoke tests for ai-review-summarize command.""" from unittest.mock import patch from automation.dagster_dev.commands.diff_summarizer import ChangeType, SmartDiffSummary from click.testing import CliRunner class TestAiReviewSummarize: """Basic smoke tests for the ai-review-summarize command.""" de...
59
2,194
dagster
python_modules/automation/automation_tests/dagster_dev_tests/ai_review_tests/test_ai_review_cache.py
.py
"""Simple smoke tests for ai-review-cache command.""" from unittest.mock import Mock, patch from click.testing import CliRunner class TestAiReviewCache: """Basic smoke tests for the ai-review-cache command.""" def test_import_and_basic_structure(self): """Test that command can be imported and has e...
68
2,438
dagster
python_modules/automation/automation_tests/dagster_dev_tests/ai_review_tests/test_ai_review_analyze_smoke.py
.py
"""Simple smoke tests for ai-review-analyze command.""" import json from unittest.mock import MagicMock, patch from click.testing import CliRunner class TestAiReviewAnalyzeSmoke: """Basic smoke tests for the ai-review-analyze command.""" def test_import_and_basic_structure(self): """Test that comma...
126
4,966
dagster
python_modules/automation/automation_tests/dagster_dev_tests/ai_review_tests/test_ai_review_update.py
.py
"""Simple smoke tests for ai-review-update command.""" from click.testing import CliRunner class TestAiReviewUpdate: """Basic smoke tests for the ai-review-update command.""" def test_import_and_basic_structure(self): """Test that command can be imported and has expected structure.""" from a...
44
1,522
dagster
python_modules/automation/automation_tests/telemetry/test_resource_telemetry.py
.py
import os import sys import dagster._check as check import pytest from dagster import ( ConfigurableResource, IOManagerDefinition, ResourceDefinition, file_relative_path, ) from dagster._config.pythonic_config import ( ConfigurableIOManager, ConfigurableIOManagerFactory, ConfigurableLegacyI...
116
3,843
dagster
python_modules/automation/automation_tests/docker_tests/test_image_defs.py
.py
import subprocess import pytest from automation.docker.image_defs import copy_directories, get_image @pytest.fixture(name="repo") def repo_fixture(tmpdir): """Test repo. repo/ ├── .git/ ├── bar/ │ └── bar.txt └── foo/ └── foo.txt """ root = (tmpdir / "repo").mkdir() wit...
82
2,447
dagster
python_modules/automation/automation_tests/docker_tests/test_dagster_docker.py
.py
import os from pathlib import Path from automation.docker.dagster_docker import DagsterDockerImage def test_image_path(): # dagster/python_modules/automation/docker/images default_images_path = os.path.join( Path(__file__).parents[2], "automation", "docker", "images", ) ...
18
439
dagster
python_modules/automation/automation/utils.py
.py
import os import subprocess from collections.abc import Iterable, Iterator from contextlib import contextmanager from distutils import spawn from pathlib import Path import click def check_output(cmd: list[str], dry_run: bool = True, cwd: str | None = None) -> str | None: if dry_run: click.echo( ...
104
3,169
dagster
python_modules/automation/automation/printer.py
.py
import os import sys from io import StringIO from types import TracebackType from typing import TYPE_CHECKING, Any if TYPE_CHECKING: from collections.abc import Callable from dagster._utils.indenting_printer import IndentingPrinter class IndentingBufferPrinter(IndentingPrinter): """Subclass of IndentingPrin...
52
1,575
dagster
python_modules/automation/automation/git.py
.py
import os import re import subprocess from automation.utils import check_output def git_check_status() -> None: changes = subprocess.check_output(["git", "status", "--porcelain"]).decode("utf-8").strip() if changes != "": raise Exception(f"Bailing: Cannot publish with changes present in git repo:\n{...
148
4,483
dagster
python_modules/automation/automation/parse_dataproc_configs.py
.py
import os import pprint from collections import namedtuple import requests from automation.printer import IndentingBufferPrinter SCALAR_TYPES = { "string": "String", "boolean": "Bool", "number": "Int", "enumeration": "String", "integer": "Int", } class List: def __init__(self, inner_type): ...
257
9,022
dagster
python_modules/automation/automation/parse_spark_configs.py
.py
"""Spark config codegen. This script parses the Spark configuration parameters downloaded from the Spark Github repository, and codegens a file that contains dagster configurations for these parameters. """ import re import sys from enum import Enum from typing import Any, NamedTuple, cast import click import reques...
292
10,970
dagster
python_modules/automation/automation/eval/cli.py
.py
import hashlib import json from datetime import datetime from functools import cached_property from pathlib import Path from typing import Any, cast import click from dagster_shared.record import record from dagster_shared.yaml_utils import safe_load_yaml from deepeval import evaluate from deepeval.metrics import GEva...
321
10,319
dagster
python_modules/automation/automation/graphql/python_client/utils.py
.py
import os import re from pathlib import Path from typing import AbstractSet, NamedTuple, cast # noqa: UP035 import dagster._check as check from dagster_graphql.client import client_queries class LegacyQueryHistoryInfo(NamedTuple): directory: str legacy_queries: AbstractSet[str] @staticmethod def ge...
58
1,874
dagster
python_modules/automation/automation/graphql/python_client/query.py
.py
import os from datetime import datetime import click import dagster_graphql from automation.graphql.python_client.utils import ( LegacyQueryHistoryInfo, are_queries_compatible, deserialize_from_query_filename, get_queries, serialize_to_query_filename, ) @click.group( name="query", help="...
126
5,364
dagster
python_modules/automation/automation/graphql/python_client/cli.py
.py
import click from automation.graphql.python_client.query import query CLI_HELP = """This CLI is used for commands related to the Dagster GraphQL client """ def create_cli(): commands = {"query": query} @click.group(commands=commands, help=CLI_HELP) def group(): pass return group cli = cr...
29
471
dagster
python_modules/automation/automation/docker/utils.py
.py
# ruff: noqa: T201 import subprocess import sys from datetime import datetime, timezone import dagster._check as check def execute_docker_build( image: str, docker_args: dict[str, str] | None = None, cwd: str | None = None, platform: str | None = None, ): check.str_param(image, "image") docke...
68
2,144
dagster
python_modules/automation/automation/docker/dagster_docker.py
.py
import contextlib import os from collections.abc import Callable, Iterator from pathlib import Path from typing import Any, NamedTuple import dagster._check as check import yaml from dagster_shared.yaml_utils import safe_load_yaml from automation.docker.ecr import ecr_image, get_aws_account_id, get_aws_region from au...
218
7,972
dagster
python_modules/automation/automation/docker/ecr.py
.py
import os import subprocess import dagster._check as check # We default to using the ECR region here DEFAULT_AWS_ECR_REGION = "us-west-2" def aws_ecr_repository(aws_account_id: str, aws_region: str = DEFAULT_AWS_ECR_REGION) -> str: """Returns the DNS hostname of the ECR registry for a given AWS account and regi...
62
1,935
dagster
python_modules/automation/automation/docker/cli.py
.py
import click import dagster._check as check from automation.docker.dagster_docker import DagsterDockerImage from automation.docker.ecr import ensure_ecr_login from automation.docker.image_defs import get_image, list_images from automation.docker.utils import current_time_str, execute_docker_push, execute_docker_tag C...
166
4,416
dagster
python_modules/automation/automation/docker/image_defs.py
.py
# ruff: noqa: T201 import contextlib import os import shutil from collections.abc import Callable, Iterator from pathlib import Path import dagster._check as check from dagster._utils import discover_oss_root from automation.docker.dagster_docker import DagsterDockerImage, default_images_path from automation.git impo...
230
6,536
dagster
python_modules/automation/automation/dagster_dev/cli.py
.py
"""Main CLI entry point for dagster-dev commands.""" import importlib import inspect import pkgutil import click from automation.dagster_dev import commands def discover_commands(): """Discover and load all commands from the commands directory. Returns: dict: Mapping of command name to click comma...
108
3,580
dagster
python_modules/automation/automation/dagster_dev/monorepo_sync/audit.py
.py
"""Core audit logic for monorepo sync completeness and correctness.""" from dataclasses import dataclass, field from pathlib import Path from automation.dagster_dev.monorepo_sync.config import SyncConfig from automation.dagster_dev.monorepo_sync.git_helpers import ( commits_with_label, extract_label_values, ...
380
12,901
dagster
python_modules/automation/automation/dagster_dev/monorepo_sync/git_helpers.py
.py
"""Git helper functions for monorepo sync auditing.""" import re import subprocess from pathlib import Path COMMIT_SEPARATOR = "---COMMIT_BOUNDARY_8f3a1b---" def git(args: list[str], cwd: Path | None = None) -> str: result = subprocess.run( ["git", *args], cwd=cwd, capture_output=True, ...
144
4,124
dagster
python_modules/automation/automation/dagster_dev/monorepo_sync/config.py
.py
"""Sync pair configurations and known-incorrect commit lists.""" from dataclasses import dataclass, field INTERNAL_REPO_URL = "https://github.com/dagster-io/internal.git" @dataclass class SyncConfig: """Configuration for a single copybara sync direction.""" name: str direction: str # "inbound" or "out...
271
14,389
dagster
python_modules/automation/automation/dagster_dev/commands/ai_review_cache.py
.py
"""Cache management command for AI code review analysis.""" import json import sys import click from automation.dagster_dev.commands.cache_manager import CacheManager @click.command(name="ai-review-cache") @click.option( "--action", type=click.Choice(["status", "clear"], case_sensitive=False), default=...
97
3,293
dagster
python_modules/automation/automation/dagster_dev/commands/gt_stack.py
.py
"""Parse gt stack information in machine-friendly formats.""" import json import subprocess import sys from typing import Any import click def parse_gt_log_output(output: str) -> list[dict[str, Any]]: """Parse the text output from 'gt log' into structured data. Args: output: The raw text output fro...
201
7,464
dagster
python_modules/automation/automation/dagster_dev/commands/cache_manager.py
.py
"""Caching system for AI code review analysis.""" import json import time from dataclasses import asdict, dataclass from pathlib import Path from typing import Any @dataclass class CacheEntry: """Repository analysis cache entry.""" commit_hash: str branch_name: str pr_number: str | None analysis...
146
4,690
dagster
python_modules/automation/automation/dagster_dev/commands/serdes.py
.py
"""Inspect registered serdes types.""" import tempfile import webbrowser import click from dagster_shared.serdes.serdes import _WHITELIST_MAP from automation.serdes.format_html import format_html from automation.serdes.format_json import format_json from automation.serdes.format_text import format_detail, format_det...
143
4,618
dagster
python_modules/automation/automation/dagster_dev/commands/ai_review_update.py
.py
"""Update PR title, body, and commit message with auto-prepare functionality.""" import json import subprocess import sys from pathlib import Path from subprocess import CompletedProcess import click import dagster._check as check from dagster._record import record @record class CommandResult: success: bool ...
237
9,305
dagster
python_modules/automation/automation/dagster_dev/commands/bk_build_status.py
.py
"""Get build status from Buildkite.""" import json import os import sys from typing import Any import click import requests from automation.dagster_dev.commands.bk_latest_build_for_pr import get_latest_build_for_pr def get_buildkite_token() -> str: """Get Buildkite API token from environment.""" token = os...
204
7,197
dagster
python_modules/automation/automation/dagster_dev/commands/diff_summarizer.py
.py
"""Smart diff summarization for AI code analysis.""" import re import subprocess from dataclasses import dataclass from enum import Enum from typing import Any class ChangeType(Enum): """Categories of code changes for different analysis approaches.""" DOCUMENTATION = "documentation" TESTS = "tests" ...
380
13,453
dagster
python_modules/automation/automation/dagster_dev/commands/bk_latest_build_for_pr.py
.py
"""Get the build number for the current PR.""" import json import subprocess import sys import click def get_latest_build_for_pr() -> str: """Get the build number for the current PR. Extracts the Buildkite build number from the current PR's checks. Handles error conditions like no PR, no checks, or no ...
97
3,002
dagster
python_modules/automation/automation/dagster_dev/commands/browse_scaffold_branch_logs.py
.py
"""Browse scaffold branch diagnostic logs command.""" from pathlib import Path import click from automation.scaffold_logs_viewer import serve_logs @click.command(name="browse-scaffold-branch-logs") @click.argument("logs_directory", type=click.Path(exists=True, file_okay=False, dir_okay=True)) @click.option("--port...
39
1,605
dagster
python_modules/automation/automation/dagster_dev/commands/ai_review_analyze.py
.py
"""Analyze PR context and repository state in machine-friendly format.""" import json import subprocess import sys from typing import Any import click from automation.dagster_dev.commands.diff_summarizer import ( format_summary_for_ai, get_smart_diff_summary, ) def run_command(cmd: list[str], description: ...
356
12,367
dagster
python_modules/automation/automation/dagster_dev/commands/monorepo_sync.py
.py
"""CLI command group for monorepo sync operations.""" import json import subprocess import tempfile from dataclasses import asdict from pathlib import Path import click from rich.console import Console from automation.dagster_dev.monorepo_sync.audit import ( CompletenessResult, CorrectnessResult, audit_i...
803
28,030
dagster
python_modules/automation/automation/dagster_dev/commands/ai_review_summarize.py
.py
"""Smart diff summarization command for AI code review.""" import json import sys import click from automation.dagster_dev.commands.diff_summarizer import ( format_summary_for_ai, get_smart_diff_summary, ) @click.command(name="ai-review-summarize") @click.option( "--diff-range", default="master..HE...
136
4,864
dagster
python_modules/automation/automation/serdes/models.py
.py
import dataclasses from typing import Any @dataclasses.dataclass(frozen=True) class Ref: name: str @dataclasses.dataclass(frozen=True) class SerdesField: name: str type_str: str | None @dataclasses.dataclass(frozen=True) class SerdesObject: typename: str class_name: str storage_name: str ...
52
1,033
dagster
python_modules/automation/automation/serdes/format_text.py
.py
import re from collections.abc import Sequence from automation.serdes.models import BuiltinType, SerdesEnum, SerdesObject, SerdesUnion def simplify_type_str(type_str: str) -> str: if not type_str: return type_str result = type_str.replace("typing.", "") def simplify_name(match): full_na...
114
3,775
dagster
python_modules/automation/automation/serdes/format_json.py
.py
import json from typing import Any from automation.serdes.registry import Registry def types_to_json(registry: Registry) -> dict[str, Any]: return { "objects": { name: { "typename": t.typename, "class_name": t.class_name, "storage_name": t.stora...
63
2,051
dagster
python_modules/automation/automation/serdes/registry.py
.py
import re import sys from abc import ABC from typing import Any, get_type_hints import click from dagster_shared.check.record import is_record from automation.serdes.models import BuiltinType, SerdesEnum, SerdesField, SerdesObject, SerdesUnion def _extract_type_string(type_annotation: Any) -> str: type_str = st...
253
9,387
dagster
python_modules/automation/automation/serdes/format_html.py
.py
import re from html import escape from automation.serdes.format_text import simplify_type_str from automation.serdes.models import BuiltinType, SerdesEnum, SerdesObject, SerdesUnion from automation.serdes.registry import Registry, _extract_referenced_types def _build_backlinks(registry: Registry) -> dict[str, list[s...
398
14,948
dagster
python_modules/automation/automation/serdes/scanner.py
.py
import importlib from pathlib import Path import click def discover_and_import_serdes_modules(package_name: str, verbose: bool): try: package = importlib.import_module(package_name) except ImportError as e: raise ImportError(f"Could not import package '{package_name}': {e}") from e # Get...
77
2,686
dagster
python_modules/automation/automation/dagster_docs/public_packages.py
.py
"""Utilities for discovering public Dagster Python packages.""" from pathlib import Path from dagster_shared.record import record @record class PublicPackage: """Information about a public Dagster package.""" name: str # Package name (e.g., "dagster", "dagster-aws") directory_name: str # Directory na...
152
5,190
dagster
python_modules/automation/automation/dagster_docs/main.py
.py
"""Unified command-line interface for Dagster documentation tools.""" import click from automation.dagster_docs.commands.check import check from automation.dagster_docs.commands.ls import ls from automation.dagster_docs.commands.watch import watch @click.group() def main(): """Dagster documentation tools.""" ...
23
438
dagster
python_modules/automation/automation/dagster_docs/__init__.py
.py
"""Unified Dagster documentation and docstring validation tools.""" from automation.dagster_docs.exclude_lists import ( EXCLUDE_MISSING_EXPORT, EXCLUDE_MISSING_PUBLIC, EXCLUDE_MISSING_RST, EXCLUDE_MODULES_FROM_PUBLIC_SCAN, EXCLUDE_RST_FILES, ) from automation.dagster_docs.main import main from auto...
40
969
dagster
python_modules/automation/automation/dagster_docs/changed_validator.py
.py
"""Functional docstring validation for changed files.""" import importlib.util import inspect from collections.abc import Callable from pathlib import Path import click from dagster._record import IHaveNew, record, record_custom from automation.dagster_docs.validator import validate_symbol_docstring @record_custom...
210
6,751
dagster
python_modules/automation/automation/dagster_docs/path_converters.py
.py
"""Path converter functions for different project layouts.""" from pathlib import Path def dagster_path_converter(file_path: Path, root_path: Path) -> str | None: """Convert Dagster project file paths to importable module paths. Handles the specific Dagster project structure: - python_modules/dagster/da...
102
3,452
dagster
python_modules/automation/automation/dagster_docs/validator.py
.py
"""Core docstring validation logic using Sphinx parsing pipeline.""" # Import the is_public function to check for @public decorator import importlib import inspect import sys from pathlib import Path from typing import Any from dagster._annotations import is_public from dagster_shared.record import record from sphinx...
433
15,320
dagster
python_modules/automation/automation/dagster_docs/exclude_lists.py
.py
"""Hardcoded exclude lists for public API validation. This file contains all the symbols that are known to have @public API inconsistencies. These lists allow incremental fixing while preventing new issues from being introduced. """ # Symbols marked @public but not yet documented in RST files EXCLUDE_MISSING_RST = { ...
558
25,841
dagster
python_modules/automation/automation/dagster_docs/cli.py
.py
"""Command-line interface for docstring validation.""" import signal import sys import time from datetime import datetime from pathlib import Path import click from automation.dagster_docs.validator import ( SymbolImporter, validate_docstring_text, validate_symbol_docstring, ) from automation.dagster_doc...
252
8,204
dagster
python_modules/automation/automation/dagster_docs/public_api_validator.py
.py
"""Utilities for validating consistency between @public decorators and RST documentation.""" import ast import re from pathlib import Path from dagster_shared.record import record from automation.dagster_docs.public_packages import get_public_dagster_packages @record class PublicSymbol: """Information about a ...
446
16,715
dagster
python_modules/automation/automation/dagster_docs/watcher.py
.py
"""File watching functionality for docstring validation.""" import time from collections.abc import Callable from pathlib import Path import click import pathspec from watchdog.events import FileSystemEventHandler from watchdog.observers import Observer from automation.dagster_docs.changed_validator import ( Val...
283
11,516
dagster
python_modules/automation/automation/dagster_docs/file_discovery.py
.py
"""File discovery functions for finding changed files.""" import subprocess from pathlib import Path def git_changed_files(root_path: Path) -> list[Path]: """Get list of Python files with uncommitted changes using git. Uses 'git diff --name-only HEAD' to find both staged and unstaged changes. """ tr...
134
3,875
dagster
python_modules/automation/automation/dagster_docs/public_symbol_utils.py
.py
"""Utilities for working with @public-annotated symbols in the Dagster codebase.""" import inspect from typing import Any from dagster._annotations import is_public def is_valid_public_method(method: Any) -> tuple[bool, Any | None]: """Check if a method is valid and @public-annotated. This function handles...
69
2,509
dagster
python_modules/automation/automation/dagster_docs/docstring_rules/sphinx_filter_rule.py
.py
"""Sphinx role filtering functions.""" from automation.dagster_docs.docstring_rules.base import ( ValidationContext, ValidationFunction, ValidationResult, ) # Filter out Sphinx role errors and warnings that are valid in the full Sphinx build context # but appear as errors in standalone docutils validation...
137
4,626
dagster
python_modules/automation/automation/dagster_docs/docstring_rules/rst_syntax_rule.py
.py
"""RST syntax validation functions.""" import io import warnings import docutils.core from automation.dagster_docs.docstring_rules.base import ( ValidationContext, ValidationFunction, ValidationResult, ) def validate_rst_syntax(context: ValidationContext, result: ValidationResult) -> ValidationResult: ...
155
5,913
dagster
python_modules/automation/automation/dagster_docs/docstring_rules/__init__.py
.py
"""Functional validation rules for docstring validation.""" from automation.dagster_docs.docstring_rules.base import ( ValidationContext, ValidationFunction, ValidationResult, ) from automation.dagster_docs.docstring_rules.python_ast_rule import ( create_python_ast_validator, validate_python_code_b...
38
1,102
dagster
python_modules/automation/automation/dagster_docs/docstring_rules/python_ast_rule.py
.py
"""Python AST validation for code blocks in docstrings.""" import ast import re from automation.dagster_docs.docstring_rules.base import ( ValidationContext, ValidationFunction, ValidationResult, ) def _extract_python_code_blocks(docstring: str) -> list[tuple[str, int]]: """Extract Python code block...
133
4,456
dagster
python_modules/automation/automation/dagster_docs/docstring_rules/base.py
.py
"""Base classes and functional interface for validation rules.""" from collections.abc import Callable from dagster_shared.record import record # Functional validation interface ValidationFunction = Callable[["ValidationContext", "ValidationResult"], "ValidationResult"] @record class ValidationContext: """Cont...
127
4,261
dagster
python_modules/automation/automation/dagster_docs/docstring_rules/section_header_rule.py
.py
"""Section header validation functions.""" import re from automation.dagster_docs.docstring_rules.base import ( ValidationContext, ValidationFunction, ValidationResult, ) # Regex pattern for potential section headers: uppercase letter followed by letters/spaces, ending with colon # Examples: "Args:", "Ex...
232
9,742
dagster
python_modules/automation/automation/dagster_docs/commands/check.py
.py
"""Check command for dagster-docs.""" import sys from pathlib import Path import click from automation.dagster_docs.changed_validator import ValidationConfig, validate_changed_files from automation.dagster_docs.exclude_lists import ( EXCLUDE_DOCSTRING_ERRORS, EXCLUDE_DOCSTRING_WARNINGS, EXCLUDE_MISSING_D...
675
23,349
dagster
python_modules/automation/automation/dagster_docs/commands/ls.py
.py
"""List command for dagster-docs.""" import sys import click from automation.dagster_docs.public_api_validator import PublicApiValidator from automation.dagster_docs.public_packages import get_public_dagster_packages from automation.dagster_docs.validator import SymbolImporter def _list_package_symbols(package: st...
84
2,582
dagster
python_modules/automation/automation/dagster_docs/commands/watch.py
.py
"""Watch command for dagster-docs.""" import signal import sys import time from datetime import datetime from pathlib import Path import click from automation.dagster_docs.changed_validator import ValidationConfig from automation.dagster_docs.path_converters import dagster_path_converter from automation.dagster_docs...
236
7,040
dagster
python_modules/automation/automation/scaffold_logs_viewer/server.py
.py
import json from http.server import BaseHTTPRequestHandler, HTTPServer from pathlib import Path from typing import Any from urllib.parse import unquote, urlparse class ScaffoldBranchLogsHandler(BaseHTTPRequestHandler): def __init__(self, *args, logs_directory: Path, **kwargs): self.logs_directory = logs_d...
142
5,404
dagster
python_modules/automation/automation/scaffold_logs_viewer/__init__.py
.py
from automation.scaffold_logs_viewer.server import serve_logs __all__ = ["serve_logs"]
4
88
dagster
python_modules/automation/python_modules/automation/automation_tests/dagster_dev_tests/ai_review_tests/test_ai_review_cache_comprehensive.py
.py
"""Comprehensive tests for ai-review-cache command targeting 85% coverage.""" import json import time from unittest.mock import Mock, patch from click.testing import CliRunner class TestAiReviewCacheComprehensive: """Comprehensive test coverage for ai-review-cache command.""" def test_import_and_basic_stru...
395
16,137
dagster
python_modules/automation/python_modules/automation/automation_tests/dagster_dev_tests/ai_review_tests/python_modules/automation/automation_tests/dagster_dev_tests/ai_review_tests/test_comprehensive.py
.py
"""Comprehensive test suite for ai-review commands targeting 80% coverage.""" import json import subprocess from unittest.mock import Mock, patch import pytest from click.testing import CliRunner class TestAiReviewCacheComprehensive: """Comprehensive tests for ai-review-cache targeting 85% coverage.""" def...
991
41,676
dagster
python_modules/automation/python_modules/automation/automation_tests/dagster_dev_tests/ai_review_tests/python_modules/automation/automation_tests/dagster_dev_tests/ai_review_tests/test_smoke.py
.py
"""Single smoke test file for ai-review command family.""" from click.testing import CliRunner class TestAiReviewSmoke: """Basic smoke tests for all ai-review commands.""" def test_cache_import(self): """Test ai-review-cache import.""" from automation.dagster_dev.commands.ai_review_cache imp...
77
2,784
dagster
python_modules/dagster/dagster_tests/conftest.py
.py
import os import subprocess import sys import dagster_shared.seven as seven import pytest from dagster._utils.env import environ from dagster_test.dg_utils.utils import scrub_tox_uv_project_environment IS_BUILDKITE = os.getenv("BUILDKITE") is not None def pytest_configure(): scrub_tox_uv_project_environment() ...
28
854
dagster
python_modules/dagster/dagster_tests/logging_tests/test_logging.py
.py
import json import logging import re import sys import threading from contextlib import contextmanager from functools import partial import dagster as dg import pytest from dagster import _check as check from dagster._core.definitions import NodeHandle from dagster._core.execution.plan.objects import StepFailureData f...
717
21,917
dagster
python_modules/dagster/dagster_tests/logging_tests/test_stdout.py
.py
import multiprocessing import os import random import string import sys import tempfile import time import dagster as dg import pytest from dagster import DagsterEventType from dagster._core.execution.compute_logs import should_disable_io_stream_redirect from dagster._core.instance import DagsterInstance from dagster....
413
15,274
dagster
python_modules/dagster/dagster_tests/logging_tests/test_log_capture.py
.py
import sys import pytest from dagster._core.execution.compute_logs import ( mirror_stream_to_file, should_disable_io_stream_redirect, ) from dagster._utils.test import get_temp_file_name @pytest.mark.skipif( should_disable_io_stream_redirect(), reason="compute logs disabled for win / py3.6+" ) def test_c...
21
613
dagster
python_modules/dagster/dagster_tests/logging_tests/test_python_logging.py
.py
import logging from collections.abc import Mapping, Sequence from unittest import mock import dagster as dg import pytest from dagster._core.definitions.reconstruct import ReconstructableJob def _reset_logging() -> None: logging.root = logging.RootLogger(logging.WARNING) logging.Logger.root = logging.root ...
446
12,712
dagster
python_modules/dagster/dagster_tests/logging_tests/test_log_manager.py
.py
import logging import sys import textwrap import dagster as dg import pytest from dagster._core.definitions.dependency import NodeHandle from dagster._core.errors import user_code_error_boundary from dagster._core.execution.plan.objects import ErrorSource, StepFailureData from dagster._core.execution.plan.outputs impo...
287
9,420
dagster
python_modules/dagster/dagster_tests/declarative_automation_tests/test_run_request_check_keys.py
.py
"""Unit tests for how declarative automation resolves the asset checks on a run request.""" from datetime import datetime, timezone import dagster as dg from dagster._core.asset_graph_view.asset_graph_view import AssetGraphView from dagster._core.definitions.assets.graph.asset_graph import AssetGraph from dagster._co...
124
5,168
dagster
python_modules/dagster/dagster_tests/declarative_automation_tests/automation_condition_tests/automation_condition_type_error_cases.py
.py
"""Type-level test cases for the automation condition APIs; the counterpart of test_type_errors.py, which runs real type checkers over a copy of this file. This is real, checked-in code (rather than a string embedded in the test) so that editors, refactoring tools, and ruff see it. The deliberately-erroneous lines are...
172
6,975
dagster
python_modules/dagster/dagster_tests/declarative_automation_tests/automation_condition_tests/test_type_errors.py
.py
"""Type-level tests for the automation condition APIs. The test asserts that: 1. every annotated line produces an error matching the regex for that checker, and 2. no other line produces any error at all (so the positive cases double as assertions that valid usage typechecks cleanly). Two checkers run as se...
206
7,583