text stringlengths 79 3.72M |
|---|
<vulnerable_code> :param mssql_conn_id: source Microsoft SQL Server connection
:param hive_cli_conn_id: Reference to the
:ref:`Hive CLI connection id <howto/connection:hive_cli>`.
:param tblproperties: TBLPROPERTIES of the hive table being created
"""
delimiter: str = chr(1),
mss... |
<vulnerable_code> :param mysql_conn_id: source mysql connection
:param hive_cli_conn_id: Reference to the
:ref:`Hive CLI connection id <howto/connection:hive_cli>`.
:param tblproperties: TBLPROPERTIES of the hive table being created
"""
escapechar: str | None = None,
mysql_conn_i... |
<vulnerable_code> input_compressed: bool = False,
tblproperties: dict | None = None,
select_expression: str | None = None,
**kwargs,
) -> None:
super().__init__(**kwargs)
self.input_compressed = input_compressed
self.tblproperties = tblproperties
self.s... |
<vulnerable_code> :param vertica_conn_id: source Vertica connection
:param hive_cli_conn_id: Reference to the
:ref:`Hive CLI connection id <howto/connection:hive_cli>`.
"""
template_fields: Sequence[str] = ("sql", "partition", "hive_table")
delimiter: str = chr(1),
vertica_conn_i... |
<vulnerable_code>"""
from __future__ import annotations
# flake8: noqa: F401
import os
__all__ = ["__version__", "login", "DAG", "PY36", "PY37", "PY38", "PY39", "PY310", "XComArg"]
__version__ = "2.6.0.dev0"
# Make `airflow` an namespace package, supporting installing
# airflow.providers.* in different locations (... |
<vulnerable_code># Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License... |
<vulnerable_code># Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License... |
<vulnerable_code># Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License... |
<vulnerable_code> yield from glob(f"{ROOT_PROJECT_DIR}/tests/system/{system_tests_dir}/*/", recursive=True)
def check_example_dags_in_provider_tocs() -> list[DocBuildError]:
"""Checks that each documentation for provider packages has a link to example DAGs in the TOC."""
build_errors = []
for provider... |
<vulnerable_code> AppflowRunFullOperator,
AppflowRunOperator,
)
SOURCE_NAME = "salesforce"
FLOW_NAME = "salesforce-campaign"
with DAG(
"example_appflow",
start_date=datetime(2022, 1, 1),
catchup=False,
tags=["example"],
) as dag:
# [START howto_operator_appflow_run]
campaign_dump = App... |
<vulnerable_code>
from datetime import datetime
from airflow.models.dag import DAG
from airflow.providers.amazon.aws.hooks.eks import ClusterStates, NodegroupStates
from airflow.providers.amazon.aws.operators.eks import (
# mypy ignore arg types (for templated fields)
# type: ignore[arg-type]
# Example Jinja Templa... |
<vulnerable_code><commit_title>[PATCH 001/147] Add gitSync optional env description (#29378)<commit_description><fixed_code>
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding cop... |
<vulnerable_code># under the License.
from __future__ import annotations
import os
from datetime import datetime
from airflow import DAG
from airflow.providers.amazon.aws.operators.glacier import (
GlacierCreateJobOperator,
GlacierUploadArchiveOperator,
)
from airflow.providers.amazon.aws.sensors.glacier impo... |
<vulnerable_code>from os import getenv
from airflow import DAG
from airflow.providers.amazon.aws.transfers.google_api_to_s3 import GoogleApiToS3Operator
GOOGLE_SHEET_ID = getenv("GOOGLE_SHEET_ID", "test-google-sheet-id")
GOOGLE_SHEET_RANGE = getenv("GOOGLE_SHEET_RANGE", "test-google-sheet-range")
S3_DESTINATION_KEY =... |
<vulnerable_code>"""
from __future__ import annotations
import os
from datetime import datetime
from airflow import DAG
from airflow.decorators import task
from airflow.models import Connection
from airflow.providers.amazon.aws.hooks.dynamodb import DynamoDBHook
from airflow.providers.amazon.aws.transfers.hive_to_dyn... |
<vulnerable_code><commit_title>[PATCH 001/147] Add gitSync optional env description (#29378)<commit_description><fixed_code>
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding cop... |
<vulnerable_code><commit_title>[PATCH 001/147] Add gitSync optional env description (#29378)<commit_description><fixed_code>
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding cop... |
<vulnerable_code><commit_title>[PATCH 001/147] Add gitSync optional env description (#29378)<commit_description><fixed_code>
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding cop... |
<vulnerable_code>}
# For an example of how to obtain the following train and test data, please see
# https://github.com/apache/airflow/blob/main/airflow/providers/amazon/aws/example_dags/example_sagemaker.py
TRAIN_DATA = "0,4.9,2.5,4.5,1.7\n1,7.0,3.2,4.7,1.4\n0,7.3,2.9,6.3,1.8\n2,5.1,3.5,1.4,0.2\n"
SAMPLE_TEST_DATA = ... |
<vulnerable_code>from __future__ import annotations
from datetime import datetime
from os import getenv
from airflow import DAG
from airflow.providers.amazon.aws.transfers.salesforce_to_s3 import SalesforceToS3Operator
S3_BUCKET_NAME = getenv("S3_BUCKET_NAME", "s3_bucket_name")
S3_KEY = getenv("S3_KEY", "s3_filename... |
<vulnerable_code> command: str,
get_pty: bool,
environment: dict | None,
timeout: int | None = None,
) -> tuple[int, bytes, bytes]:
self.log.info("Running command: %s", command)
if timeout is None:
timeout = self.cmd_timeout # type: ignore[assignment]
... |
<vulnerable_code> )
assert self.ssh_hook
return self.ssh_hook.exec_ssh_client_command(
ssh_client, command, environment=self.environment, get_pty=self.get_pty
)
def raise_for_status(self, exit_status: int, stderr: bytes, context=None) -> None:
def run_ssh_client_comma... |
<vulnerable_code> )
assert ret == (0, b"airflow\n", b"")
@pytest.mark.flaky(reruns=5)
def test_command_timeout_default(self):
hook = SSHHook(
ssh_conn_id="ssh_default",
conn_timeout=30,
banner_timeout=100,
)
with hook.get_conn(... |
<vulnerable_code>from airflow.providers.ssh.hooks.ssh import SSHHook
from airflow.providers.ssh.operators.ssh import SSHOperator
from airflow.utils.timezone import datetime
from tests.test_utils.config import conf_vars
TEST_DAG_ID = "unit_tests_ssh_test_op"
result = task.execute(None)
assert re... |
<vulnerable_code> :param region_name: aws region name (example: us-east-1)
:param iam_role_name: AWS IAM Role for Glue Job Execution
:param create_job_kwargs: Extra arguments for Glue Job Creation
Additional arguments (such as ``aws_conn_id``) may be specified and
are passed down to the underlying A... |
<vulnerable_code> :param run_job_kwargs: Extra arguments for Glue Job Run
:param wait_for_completion: Whether or not wait for job run completion. (default: True)
:param verbose: If True, Glue Job Run logs show in the Airflow Task Logs. (default: False)
"""
template_fields: Sequence[str] = (
... |
<vulnerable_code> assert "Arn" in iam_role["Role"]
assert iam_role["Role"]["Arn"] == f"arn:aws:iam::123456789012:role{role_path}{expected_role}"
@mock.patch.object(AwsBaseHook, "get_conn")
def test_has_job_exists(self, mock_get_conn):
job_name = "aws_test_glue_job"
mock_get_conn.... |
<vulnerable_code> conn_data = {"url": "", "schema": "", "conn_prefix": "", "user": "", "password": ""}
try:
conn = self.get_connection(self._jdbc_conn_id)
if conn.port:
conn_data["url"] = f"{conn.host}:{conn.port}"
else:<commit_title>[PATCH 001/147] Add... |
<vulnerable_code># under the License.
from __future__ import annotations
from airflow.models import Connection
from airflow.providers.apache.spark.hooks.spark_jdbc import SparkJDBCHook
from airflow.utils import db
extra='{"conn_prefix":"jdbc:postgresql://"}',
)
)
def test_resol... |
<vulnerable_code> """Establish a connection to Drillbit."""
conn_md = self.get_connection(getattr(self, self.conn_name_attr))
creds = f"{conn_md.login}:{conn_md.password}@" if conn_md.login else ""
engine = create_engine(
f'{conn_md.extra_dejson.get("dialect_driver", "drill+sa... |
<vulnerable_code># under the License.
from __future__ import annotations
from unittest.mock import MagicMock
from airflow.providers.apache.drill.hooks.drill import DrillHook
class TestDrillHook:
def setup_method(self):
self.cur = MagicMock(rowcount=0)<commit_title>[PATCH 001/147] Add gitSync optional en... |
<vulnerable_code> self._submit_sp: Any | None = None
self._yarn_application_id: str | None = None
self._kubernetes_driver_pod: str | None = None
self._spark_binary = spark_binary
if self._spark_binary is not None and self._spark_binary not in ALLOWED_SPARK_BINARIES:
ra... |
<vulnerable_code> assert connection == expected_spark_connection
assert cmd[0] == "spark3-submit"
def test_resolve_connection_custom_spark_binary_not_allowed_runtime_error(self):
with pytest.raises(RuntimeError):
SparkSubmitHook(conn_id="spark_binary_set", spark_binary="another-c... |
<vulnerable_code> reap_process_group,
set_new_process_group,
)
from airflow.utils.session import NEW_SESSION, provide_session
from airflow.utils.sqlalchemy import prohibit_commit, skip_locked, with_row_locks
@provide_session
def _fetch_callbacks(self, max_callbacks: int, session: Session = NEW_SESSION)... |
<vulnerable_code>
from graphviz.dot import Dot
from sqlalchemy.orm import Session
from sqlalchemy.sql.functions import func
from airflow import settings
from airflow.api.client import get_current_api_client
from airflow.models import DagBag, DagModel, DagRun, TaskInstance
from airflow.models.dag import DAG
from airflo... |
<vulnerable_code>
import pendulum
import pytest
from airflow import settings
from airflow.cli import cli_parser
from airflow.models.serialized_dag import SerializedDagModel
from airflow.utils import timezone
from airflow.utils.session import create_session
from airflow.utils.state import State
from airflow.utils.types... |
<vulnerable_code> gcp_conn_id: str = "google_cloud_default",
delegate_to: str | None = None,
impersonation_chain: str | Sequence[str] | None = None,
**kwargs,
) -> None:
super().__init__(**kwargs)
self.project_id = project_id
self.delegate_to = delegate_to
... |
<vulnerable_code> partition_id=TEST_PARTITION_ID,
)
@pytest.fixture()
def context():
class TestBigQueryTableExistencePartitionAsyncSensor:
def test_big_query_table_existence_partition_sensor_async(self):
"""
Asserts that a task is deferred and a BigQueryTablePartitionExistence... |
<vulnerable_code> )
# [END howto_sensor_bigquery_table_partition]
# [START howto_sensor_bigquery_table_partition_async]
check_table_partition_exists_async: BaseSensorOperator = BigQueryTableExistencePartitionAsyncSensor(
task_id="check_table_partition_exists_async",<commit_title>[PATCH 001/147] ... |
<vulnerable_code> log.debug("registering %s for stringifying", c)
_stringifiers[c] = name
log.info("loading serializers took %.3f seconds", timer.duration)
@functools.lru_cache(maxsize=None)<commit_title>[PATCH 001/147] Add gitSync optional env description (#29378)<commit_descripti... |
<vulnerable_code> f"[info]Skip tagging {image_params.airflow_image_name} as latest as it is already 'latest'[/]"
)
return subprocess.CompletedProcess(returncode=0, args=[])
return run_command(
[
"docker",
"tag",
image_params.airflow_image_name_w... |
<vulnerable_code>def requires_access(permissions: Sequence[tuple[str, str]] | None = None) -> Callable[[T], T]:
"""Factory for decorator that checks current user's permissions against required permissions."""
appbuilder = get_airflow_app().appbuilder
appbuilder.sm.sync_resource_permissions(permissions)
... |
<vulnerable_code> view.datamodel = CustomSQLAInterface(view.datamodel.obj)
self.perms = None
def _get_root_dag_id(self, dag_id):
if "." in dag_id:
dm = (<commit_title>[PATCH 001/147] Add gitSync optional env description (#29378)<commit_description><fixed_code>
vie... |
<vulnerable_code>
from airflow import DAG
from airflow.exceptions import AirflowSkipException
from airflow.operators.empty import EmptyOperator
from airflow.utils.context import Context
from airflow.utils.trigger_rule import TriggerRule
# Create some placeholder operators
class EmptySkipOperator(EmptyOperator):
"... |
<vulnerable_code>
def remove_task_decorator(python_source: str, task_decorator_name: str) -> str:
"""
Removed @kubernetes_task
:param python_source:
"""
if task_decorator_name not in python_source:
return python_source
split = python_source.split(task_decorator_name)
before_decorato... |
<vulnerable_code>
def remove_task_decorator(python_source: str, task_decorator_name: str) -> str:
"""
Removed @task.
:param python_source:
"""
if task_decorator_name not in python_source:
return python_source
split = python_source.split(task_decorator_name)
before_decorator, after_d... |
<vulnerable_code>
import pytest
from airflow.decorators import task
from airflow.utils import timezone
DEFAULT_DATE = timezone.datetime(2016, 1, 1)
ret = f(datetime.datetime.utcnow())
ret.operator.run(start_date=DEFAULT_DATE, end_date=DEFAULT_DATE)<commit_title>[PATCH 001/147] Add gitSync optiona... |
<vulnerable_code>
import pytest
from airflow.decorators import task
from airflow.utils import timezone
DEFAULT_DATE = timezone.datetime(2016, 1, 1)
ret = f(datetime.datetime.utcnow())
ret.operator.run(start_date=DEFAULT_DATE, end_date=DEFAULT_DATE)<commit_title>[PATCH 001/147] Add gitSync optiona... |
<vulnerable_code>
import pytest
from airflow.decorators import task
from airflow.utils import timezone
DEFAULT_DATE = timezone.datetime(2021, 9, 1)
# Second container is xcom image
assert containers[1].image == XCOM_IMAGE
assert containers[1].volume_mounts[0].mount_path == "/airflow/xcom"<commit_title>[PA... |
<vulnerable_code>
import pytest
from airflow.decorators import task
from airflow.exceptions import AirflowException
from airflow.models import TaskInstance
from airflow.models.dag import DAG
ret.operator.run(start_date=dr.execution_date, end_date=dr.execution_date)
ti = dr.get_task_instances()[... |
<vulnerable_code># jobs check
ARG_JOB_TYPE_FILTER = Arg(
("--job-type",),
choices=("BackfillJob", "LocalTaskJob", "SchedulerJob", "TriggererJob"),
action="store",
help="The type of job(s) that will be checked.",
)<commit_title>[PATCH 001/147] Add gitSync optional env description (#29378)<commit_descript... |
<vulnerable_code>from airflow.callbacks.callback_requests import CallbackRequest, SlaCallbackRequest
from airflow.configuration import conf
from airflow.dag_processing.processor import DagFileProcessorProcess
from airflow.models import errors
from airflow.models.dag import DagModel
from airflow.models.dagwarning import... |
<vulnerable_code> processor_timeout=processor_timeout,
dag_ids=dag_ids,
pickle_dags=pickle_dags,
)
super().__init__(*args, **kwargs)
<commit_title>[PATCH 001/147] Add gitSync optional env description (#29378)<commit_description><fixed_code>
processor_timeou... |
<vulnerable_code>
import airflow.jobs.backfill_job
import airflow.jobs.base_job
import airflow.jobs.local_task_job
import airflow.jobs.scheduler_job
import airflow.jobs.triggerer_job<commit_title>[PATCH 001/147] Add gitSync optional env description (#29378)<commit_description><fixed_code>
impor... |
<vulnerable_code> task_id="resume_cluster",
cluster_identifier=redshift_cluster_identifier,
)
resume_cluster_in_deferred_mode = RedshiftResumeClusterOperator(
task_id="resume_cluster_in_deferred_mode",
cluster_identifier=redshift_cluster_identifier,
deferrable=True,
)... |
<vulnerable_code># under the License.
from __future__ import annotations
import jenkins
from airflow.hooks.base import BaseHook
from airflow.utils.strings import to_boolean
class JenkinsHook(BaseHook):
conn_type = "jenkins"
hook_name = "Jenkins"
def __init__(self, conn_id: str = default_conn_name) -> N... |
<vulnerable_code> """tests `init` method to validate http client creation when all parameters are passed"""
default_connection_id = "jenkins_default"
connection_host = "http://test.com"
connection_port = 8080
get_connection_mock.return_value = mock.Mock(
connection_id... |
<vulnerable_code> def _get_root_dag_id(self, dag_id):
if "." in dag_id:
dm = (
self.get_session.query(DagModel.dag_id, DagModel.root_dag_id)
.filter(DagModel.dag_id == dag_id)
.first()
)
:param role_name: the name of a role in t... |
<vulnerable_code> hook_name = "HDFS"
def __init__(
self, hdfs_conn_id: str = "hdfs_default", proxy_user: str | None = None, autoconfig: bool = False
):
super().__init__()
if not snakebite_loaded:
"snakebite is not compatible with Python 3 "
"(as of Aug... |
<vulnerable_code> HDFSHook(hdfs_conn_id="hdfs_missing", autoconfig=True).get_conn()
mock_client.assert_called_once_with(effective_user=None, use_sasl=False)
@mock.patch("airflow.providers.apache.hdfs.hooks.hdfs.HDFSHook.get_connections")
def test_get_ha_client(self, mock_get_connections):
... |
<vulnerable_code> self._pickle_dags = pickle_dags
self._dag_ids = dag_ids
self._async_mode = async_mode
self._parsing_start_time: int | None = None
self._dag_directory = dag_directory
self._job = job
<commit_title>[PATCH 001/147] Add gitSync optional env description (#2937... |
<vulnerable_code> self._file_stats.pop(file_path, None)
file_paths_to_stop_watching.add(file_path)
continue
file_modified_time = timezone.make_aware(datetime.fromtimestamp(files_with_mtime[file_path]))
else:
file_path... |
<vulnerable_code>import socket
import sys
import threading
from datetime import datetime, timedelta
from logging.config import dictConfig
from tempfile import TemporaryDirectory
manager.prepare_file_path_queue()
assert manager._file_path_queue == expected_order
@conf_vars({("scheduler", "file_parsi... |
<vulnerable_code> f"`{rich_click_key}` group in `{command_path_config(command)}`."
)
get_console().print(
"[warning]Please remove it from there od add parameter in "
"the command. NOTE! This error might be pri... |
<vulnerable_code> console.print(f"[red]The PR #{pr_number} could not be found[/]")
continue
if pr.user.login == "dependabot":
console.print(f"[yellow]Skipping PR #{pr_number} as it was created by dependabot[/]")
continue
# I... |
<vulnerable_code> decorator_name: str = attr.ib(repr=False, default="task")
_airflow_is_task_decorator: ClassVar[bool] = True
@multiple_outputs.default
def _infer_multiple_outputs(self):
multiple_outputs=self.multiple_outputs,
**self.kwargs,
)
op_doc_attrs = [op.... |
<vulnerable_code># under the License.
from __future__ import annotations
import functools
import types
from typing import Callable
from airflow.decorators import python_task
from airflow.utils.setup_teardown import SetupTeardownContext
def setup_task(python_callable: Callable) -> Callable:
# Using FunctionType ... |
<vulnerable_code>from airflow.utils.helpers import validate_key
from airflow.utils.operator_resources import Resources
from airflow.utils.session import NEW_SESSION, provide_session
from airflow.utils.setup_teardown import SetupTeardownContext
from airflow.utils.trigger_rule import TriggerRule
from airflow.utils.weight... |
<vulnerable_code># Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License... |
<vulnerable_code>from airflow.models.taskmixin import DAGNode, DependencyMixin
from airflow.serialization.enums import DagAttributeTypes
from airflow.utils.helpers import validate_group_key
from airflow.utils.setup_teardown import SetupTeardownContext
if TYPE_CHECKING:
from sqlalchemy.orm import Session
se... |
<vulnerable_code> assert teardown_task._is_teardown
def test_setup_taskgroup_decorator(self, dag_maker):
@setup
@task_group
def mygroup():
@task
def mytask():
print("I am a setup task")
mytask()
with dag_maker():
... |
<vulnerable_code> "on_retry_callback",
# Checked separately
"resources",
}
else: # Promised to be mapped by the assert above.
assert isinstance(serialized_task, MappedOperator)<commit_title>[PATCH 001/147] Add gitSync optional env descripti... |
<vulnerable_code>#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "Licen... |
<vulnerable_code>
def sign_the_release(repo_root):
if confirm_action("Do you want to sign the release?"):
os.chdir(repo_root)
run_command("./dev/sign.sh dist/*", dry_run_override=DRY_RUN, check=True, shell=True)
console_print("Release signed")
<commit_title>[PATCH 001/147] Add gitSync optio... |
<vulnerable_code>import time
from typing import TYPE_CHECKING, Sequence, cast
from airflow.api.common.trigger_dag import trigger_dag
from airflow.exceptions import AirflowException, DagNotFound, DagRunAlreadyExists
from airflow.models.baseoperator import BaseOperator, BaseOperatorLink
from airflow.models.dagbag import... |
<vulnerable_code> )
with pytest.raises(DagRunAlreadyExists):
task.run(start_date=execution_date, end_date=execution_date)<commit_title>[PATCH 001/147] Add gitSync optional env description (#29378)<commit_description><fixed_code>
)
with pytest.raises(DagRunAlreadyExists):
... |
<vulnerable_code># under the License.
from __future__ import annotations
from datetime import timedelta
from typing import TYPE_CHECKING, Any, Sequence
AzureDataFactoryPipelineRunException,
AzureDataFactoryPipelineRunStatus,
)
from airflow.providers.microsoft.azure.triggers.data_factory import (
ADFPipeli... |
<vulnerable_code> "poke_interval": 15,
}
self.sensor = AzureDataFactoryPipelineRunStatusSensor(task_id="pipeline_run_sensor", **self.config)
def test_init(self):
assert self.sensor.azure_data_factory_conn_id == self.config["azure_data_factory_conn_id"]
with pytest.rai... |
<vulnerable_code> )
# Performs polling on the Airflow Triggerer thus freeing up resources on Airflow Worker
pipeline_run_async_sensor = AzureDataFactoryPipelineRunStatusAsyncSensor(
task_id="pipeline_run_async_sensor",
run_id=cast(str, XComArg(run_pipeline2, key="run_id")),<commit_title>[PAT... |
<vulnerable_code> recorded_pid = psutil.Process(ti.pid).ppid()
same_process = recorded_pid == current_pid
if recorded_pid is not None and not same_process:
self.log.warning(
"Recorded pid %s does not match the current pid %s", recorded_pid,... |
<vulnerable_code> returncodes[p.pid] = p.returncode
def signal_procs(sig):
try:
logger.info("Sending the signal %s to group %s", sig, process_group_id)
os.killpg(process_group_id, sig)
else:
raise
if process_group_id == os.getpgid(0):
... |
<vulnerable_code> :param factory_name: The factory name.
:param config: Extra parameters for the ADF client.
"""
async with await self.get_async_conn() as client:
try:
pipeline_run = await client.pipeline_runs.get(resource_group_name, factory_name, run_id)
... |
<vulnerable_code>}
let zoom = null;
function setUpZoomSupport() {
// Set up zoom support for Graph
const padding = width * 0.05;
// Calculate applicable scale for zoom
const zoomScale =
Math.min(Math.min(width / graphWidth, height / graphHeight)) * 0.8;
zoom.translate([width / 2 - (graphWidth * zoomSc... |
<vulnerable_code> extra=json.dumps({"extra__azure_data_factory__factory_name": DATAFACTORY_NAME})
)
mock_get_connection.return_value = mock_connection
mock_conn.return_value.__aenter__.return_value.pipeline_runs.get.return_value = mock_pipeline_run
hook = AzureDataFactoryAsync... |
<vulnerable_code>
// Calculate zoom scale to fill most of the canvas with the node/cluster in focus.
const scale =
Math.min(Math.min(width / nodeWidth, height / nodeHeight), maxZoom) * 0.8;
// Move the graph so that the node that was expanded/collapsed is centered around
// the mouse click.<commi... |
<vulnerable_code> gcp_conn_id: str = "google_cloud_default",
delegate_to: str | None = None,
impersonation_chain: str | Sequence[str] | None = None,
**kwargs,
) -> None:
super().__init__(**kwargs)
self.project_id = project_id
self.delegate_to = delegate_to
... |
<vulnerable_code> project_id=TEST_PROJECT_ID, dataset_id=TEST_DATASET_ID, table_id=TEST_TABLE_ID
)
class TestBigqueryTablePartitionExistenceSensor:
@mock.patch("airflow.providers.google.cloud.sensors.bigquery.BigQueryHook")
class TestBigQueryTableExistenceAsyncSensor:
def test_big_query_t... |
<vulnerable_code> )
# [END howto_sensor_bigquery_table]
# [START howto_sensor_async_bigquery_table]
check_table_exists_async = BigQueryTableExistenceAsyncSensor(
task_id="check_table_exists_async",<commit_title>[PATCH 001/147] Add gitSync optional env description (#29378)<commit_description><fix... |
<vulnerable_code>from airflow_breeze.commands.production_image_commands import prod_image # noqa
from airflow_breeze.commands.release_management_commands import release_management # noqa
from airflow_breeze.commands.setup_commands import setup # noqa
from airflow_breeze.commands.testing_commands import testing # no... |
<vulnerable_code> extra_args.append("--no-rcs")
elif shell_binary.endswith("bash"):
extra_args.extend(["--norc", "--noprofile"])
result = run_command([shell_binary, *extra_args, *shell_args], env=env, check=False)
if result.returncode != 0:
sys.exit(result.returncode)
extra_s... |
<vulnerable_code>
from airflow_breeze.commands.ci_image_commands import ci_image
from airflow_breeze.commands.production_image_commands import prod_image
from airflow_breeze.commands.testing_commands import testing
from airflow_breeze.configure_rich_click import click
from airflow_breeze.utils.click_utils import Breeze... |
<vulnerable_code>
@click.group(cls=BreezeGroup, name="testing", help="Tools that developers can use to run tests")
def testing():
pass
@testing.command(
name="docker-compose-tests",
context_settings=dict(
ignore_unknown_options=True,
)
@testing.command(
name="tests",
help="Run the s... |
<vulnerable_code>ALLOWED_TEST_TYPE_CHOICES = [
"All",
*all_selective_test_types(),
"Helm",
"Postgres",
"MySQL",
"Quarantine",<commit_title>[PATCH 001/147] Add gitSync optional env description (#29378)<commit_description><fixed_code>
ALLOWED_TEST_TYPE_CHOICES = [
"All",
*all_selective_tes... |
<vulnerable_code> ("images", "/opt/airflow/images"),
("logs", "/root/airflow/logs"),
("pyproject.toml", "/opt/airflow/pyproject.toml"),
("pytest.ini", "/opt/airflow/pytest.ini"),
("scripts", "/opt/airflow/scripts"),
("scripts/docker/entrypoint_ci.sh", "/entrypoint"),
("setup.cfg", "/opt/airfl... |
<vulnerable_code> check: bool = True,
no_output_dump_on_exception: bool = False,
env: Mapping[str, str] | None = None,
cwd: Path | None = None,
input: str | None = None,
output: Output | None = None,
output_outside_the_group: bool = False,<commit_title>[PATCH 001/147] Add gitSync optional env... |
<vulnerable_code><commit_title>[PATCH 001/147] Add gitSync optional env description (#29378)<commit_description><fixed_code>
|
<vulnerable_code>if TYPE_CHECKING:
from airflow.models.taskinstance import TaskInstance
@pytest.fixture()
def reset_environment():
config.addinivalue_line(
"markers", "credential_file(name): mark tests that require credential file in CREDENTIALS_DIR"
)
os.environ["_AIRFLOW__SKIP_DATABASE_EXECU... |
<vulnerable_code> # context using dill (which is slow apparently).
@pytest.mark.execution_timeout(120)
@pytest.mark.filterwarnings("ignore::airflow.utils.context.AirflowContextDeprecationWarning")
def test_airflow_context(self):
def f(
# basic<commit_title>[PATCH 001/147] Add gitSync ... |
<vulnerable_code>import contextlib
import io
import json
import runpy
from unittest import mock
import pytest
import time_machine
class TestGetEksToken:
@mock.patch("airflow.providers.amazon.aws.hooks.eks.EksHook")
) = "k8s-aws-v1.aHR0cDovL2V4YW1wbGUuY29t"
with mock.patch("sys.argv", args), cont... |
<vulnerable_code> with mock.patch.dict("os.environ", FLASK_APP="airflow.www.app:cached_app"), mock.patch.object(
sys, "argv", ["flask", "routes"]
), pytest.raises(SystemExit):
runpy.run_module("flask", run_name="__main__")
output = capsys.readouterr()
assert "/log... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.