text stringlengths 79 3.72M |
|---|
<vulnerable_code>
from typing import Any
from sqlalchemy import MetaData, String
from sqlalchemy.orm import registry
from airflow.configuration import conf
def StringID(*, length=ID_LEN, **kwargs) -> String:
return String(length=length, **kwargs, **COLLATION_ARGS)<commit_title>[PATCH 001/111] Add zlib1g-dev pack... |
<vulnerable_code>from sqlalchemy.orm import relationship
from airflow.configuration import conf
from airflow.models.base import Base, StringID
from airflow.serialization.helpers import serialize_template_field
from airflow.settings import json
from airflow.utils.retries import retry_db_transaction
from airflow.mod... |
<vulnerable_code>from sqlalchemy import Column, ForeignKeyConstraint, Index, Integer, text
from sqlalchemy.orm import relationship
from airflow.models.base import Base, StringID
from airflow.utils.sqlalchemy import UtcDateTime
class TaskFail(Base):
"""TaskFail tracks the failed run durations of each task instanc... |
<vulnerable_code> XComForMappingNotPushed,
)
from airflow.listeners.listener import get_listener_manager
from airflow.models.base import Base, StringID
from airflow.models.dagbag import DagBag
from airflow.models.log import Log
from airflow.models.mappedoperator import MappedOperator
from airflow.models.dataset ... |
<vulnerable_code>
from sqlalchemy import CheckConstraint, Column, ForeignKeyConstraint, Integer, String
from airflow.models.base import COLLATION_ARGS, ID_LEN, Base
from airflow.utils.sqlalchemy import ExtendedJSON
if TYPE_CHECKING:
LIST = "list"
class TaskMap(Base):
"""Model to track dynamic task-mapping i... |
<vulnerable_code>from sqlalchemy.orm import relationship
from airflow.exceptions import RemovedInAirflow3Warning
from airflow.models.base import COLLATION_ARGS, ID_LEN, Base
from airflow.utils.session import NEW_SESSION, provide_session
from airflow.utils.sqlalchemy import UtcDateTime
from airflow.models.taskinst... |
<vulnerable_code>from airflow.api_internal.internal_api_call import internal_api_call
from airflow.configuration import conf
from airflow.exceptions import RemovedInAirflow3Warning
from airflow.models.base import COLLATION_ARGS, ID_LEN, Base
from airflow.utils import timezone
from airflow.utils.helpers import exactly_o... |
<vulnerable_code> self.redis = None
self.host = None
self.port = None
self.password = None
self.db = None
conn = self.get_connection(self.redis_conn_id)
self.host = conn.host
self.port = conn.port
self.password = None if str(conn.password).lower() ... |
<vulnerable_code> @mock.patch(
"airflow.providers.redis.hooks.redis.RedisHook.get_connection",
return_value=Connection(
password="password",
host="remote_host",
port=1234,
hook.get_conn()
mock_redis.assert_called_once_with(
host=connecti... |
<vulnerable_code>"""RedisHook module."""
from __future__ import annotations
from redis import Redis
from airflow.hooks.base import BaseHook
"ssl_cert_reqs",
"ssl_ca_certs",
"ssl_keyfile",
"ssl_cert_file",
"ssl_check_hostname",
]
ssl_args = ... |
<vulnerable_code>
import pytest
from airflow.models import Connection
from airflow.providers.redis.hooks.redis import RedisHook
class TestRedisHook:
def test_get_conn(self):
hook = RedisHook(redis_conn_id="redis_default")
assert hook.redis is None
"ssl_cert_reqs": "requir... |
<vulnerable_code> mock_redis.assert_called_once_with(
host=connection.host,
password=connection.password,
port=connection.port,
db=connection.extra_dejson["db"],
ssl=connection.extra_dejson["ssl"],<commit_title>[PATCH 001/111] Add zlib1g-dev package to ... |
<vulnerable_code>from __future__ import annotations
import warnings
from redis import Redis
from airflow.exceptions import AirflowProviderDeprecationWarning
from airflow.hooks.base import BaseHook
class RedisHook(BaseHook):
"""
)
return self.redis<commit_title>[PATCH 001/111] Add zlib1g-de... |
<vulnerable_code>import os
import sys
from collections import defaultdict
from typing import Callable, Iterable, NamedTuple, TypeVar
from rich.console import Console
from tabulate import tabulate
def build_docs_for_packages(
current_packages: list[str],
docs_only: bool,
spellcheck_only: bool,
jobs: i... |
<vulnerable_code># under the License.
from __future__ import annotations
from typing import TYPE_CHECKING, ClassVar
from airflow.io import get_fs, has_fs
protocol: str
storage_options: Properties | None
_fs: AbstractFileSystem | None = None
def __init__(
self,
protocol: str,
):
... |
<vulnerable_code>
assert s["protocol"] == "file"
assert s["conn_id"] == "mock"
assert s["filesystem"] is None
assert store == d
store = attach("localfs", fs=LocalFileSystem())<commit_title>[PATCH 001/111] Add zlib1g-dev package to Airflow images (#36493)<commit_description>Seems... |
<vulnerable_code><commit_title>[PATCH 001/111] Add zlib1g-dev package to Airflow images (#36493)<commit_description>Seems that when mysql repository is used to install mysql client,
it induces libxml compilation for Python 3.8 and 3.9 and this
library requires devel version of zlib that is missing in the image.
This P... |
<vulnerable_code><commit_title>[PATCH 001/111] Add zlib1g-dev package to Airflow images (#36493)<commit_description>Seems that when mysql repository is used to install mysql client,
it induces libxml compilation for Python 3.8 and 3.9 and this
library requires devel version of zlib that is missing in the image.
This P... |
<vulnerable_code><commit_title>[PATCH 001/111] Add zlib1g-dev package to Airflow images (#36493)<commit_description>Seems that when mysql repository is used to install mysql client,
it induces libxml compilation for Python 3.8 and 3.9 and this
library requires devel version of zlib that is missing in the image.
This P... |
<vulnerable_code><commit_title>[PATCH 001/111] Add zlib1g-dev package to Airflow images (#36493)<commit_description>Seems that when mysql repository is used to install mysql client,
it induces libxml compilation for Python 3.8 and 3.9 and this
library requires devel version of zlib that is missing in the image.
This P... |
<vulnerable_code><commit_title>[PATCH 001/111] Add zlib1g-dev package to Airflow images (#36493)<commit_description>Seems that when mysql repository is used to install mysql client,
it induces libxml compilation for Python 3.8 and 3.9 and this
library requires devel version of zlib that is missing in the image.
This P... |
<vulnerable_code><commit_title>[PATCH 001/111] Add zlib1g-dev package to Airflow images (#36493)<commit_description>Seems that when mysql repository is used to install mysql client,
it induces libxml compilation for Python 3.8 and 3.9 and this
library requires devel version of zlib that is missing in the image.
This P... |
<vulnerable_code>import pendulum
from airflow.decorators import dag, task, teardown
from airflow.providers.weaviate.hooks.weaviate import WeaviateHook
from airflow.providers.weaviate.operators.weaviate import WeaviateIngestOperator
sample_data_with_vector = [
{
Example Weaviate DAG demonstrating usage of the ... |
<vulnerable_code><commit_title>[PATCH 001/111] Add zlib1g-dev package to Airflow images (#36493)<commit_description>Seems that when mysql repository is used to install mysql client,
it induces libxml compilation for Python 3.8 and 3.9 and this
library requires devel version of zlib that is missing in the image.
This P... |
<vulnerable_code><commit_title>[PATCH 001/111] Add zlib1g-dev package to Airflow images (#36493)<commit_description>Seems that when mysql repository is used to install mysql client,
it induces libxml compilation for Python 3.8 and 3.9 and this
library requires devel version of zlib that is missing in the image.
This P... |
<vulnerable_code> conn_id: str | None = None,
**kwargs: typing.Any,
) -> None:
if parsed_url and parsed_url.scheme:
self._store = attach(parsed_url.scheme, conn_id)
else:
@property
def key(self) -> str:
if self._url:
return self._url.path
... |
<vulnerable_code>from airflow.models import BaseOperator
if TYPE_CHECKING:
from airflow.utils.context import Context
self.overwrite = overwrite
def execute(self, context: Context) -> None:
src: ObjectStoragePath
dst: ObjectStoragePath
if isinstance(self.src, str):
... |
<vulnerable_code> "tests/providers/common/io/operators/test_file_transfer.py",
),
{
"affected-providers-list-as-string": "common.io",
"all-python-versions": "['3.8']",
"all-python-versions-list-as-string": "3.8",
"pyt... |
<vulnerable_code> def test_init_objectstoragepath(self):
path = ObjectStoragePath("file://bucket/key/part1/part2")
assert path.bucket == "bucket"
assert path.key == "/key/part1/part2"
assert path.protocol == "file"
path2 = ObjectStoragePath(path / "part3")
assert path... |
<vulnerable_code>
from unittest import mock
from airflow.providers.common.io.operators.file_transfer import FileTransferOperator
)
source_path.copy.assert_called_once_with(target_path)
target_path.copy.assert_not_called()<commit_title>[PATCH 001/111] Add zlib1g-dev package to Airflow images (... |
<vulnerable_code>
if TYPE_CHECKING:
from airflow.models.connection import Connection
class RedshiftSQLHook(DbApiHook):
conn_kwargs_dejson = self.conn.extra_dejson
conn_kwargs: dict = {**conn_params, **conn_kwargs_dejson}
return redshift_connector.connect(**conn_kwargs)<commit_title>[PATCH ... |
<vulnerable_code> is_cross_db: bool
information_schema_columns: list[str]
information_schema_table: str
is_uppercase_names: bool
database: str | None
:param database: Takes precedence over parsed database name.
:param information_schema_columns: List of columns names from information schema ... |
<vulnerable_code>from attrs import define
from openlineage.client.facet import SchemaDatasetFacet, SchemaField
from openlineage.client.run import Dataset
from sqlalchemy import Column, MetaData, Table, and_, union_all
if TYPE_CHECKING:
from sqlalchemy.engine import Engine
ORDINAL_POSITION = 3
# Use 'udt_na... |
<vulnerable_code>LOGIN_HOST = "host"
LOGIN_PORT = 5439
LOGIN_SCHEMA = "dev"
class TestRedshiftSQLHookConn:
ClusterIdentifier=expected_cluster_identifier,
AutoCreate=False,
)<commit_title>[PATCH 001/111] Add zlib1g-dev package to Airflow images (#36493)<commit_description>Se... |
<vulnerable_code><commit_title>[PATCH 001/111] Add zlib1g-dev package to Airflow images (#36493)<commit_description>Seems that when mysql repository is used to install mysql client,
it induces libxml compilation for Python 3.8 and 3.9 and this
library requires devel version of zlib that is missing in the image.
This P... |
<vulnerable_code>@pytest.mark.parametrize(
"schema_mapping, expected",
[
pytest.param({None: ["C1", "C2"]}, ["information_schema.columns.table_name IN ('C1', 'C2')"]),
pytest.param(
{"Schema1": ["Table1"], "Schema2": ["Table2"]},
[
"information_schema.colu... |
<vulnerable_code>
start_dttm = timezone.utcnow()
self.last_scheduling_decision = start_dttm
with Stats.timer(
f"dagrun.dependency-check.{self.dag_id}",
tags=self.stats_tags,
):
dag = self.get_dag()
info = self.task_instance_scheduling_decis... |
<vulnerable_code> if not self.next_method:
self.clear_xcom_data()
with Stats.timer(f"dag.{self.task.dag_id}.{self.task.task_id}.duration", tags=self.stats_tags):
# Set the validated/merged params on the task object.
self.task.params = context["params"]
<commit_title>[... |
<vulnerable_code> NullTimetable,
OnceTimetable,
)
from airflow.utils import timezone
from airflow.utils.dag_cycle_tester import check_cycle
from airflow.utils.dates import cron_presets, date_range as utils_date_range
if isinstance(interval, (timedelta, relativedelta)):
return DeltaDataIntervalTimetab... |
<vulnerable_code><commit_title>[PATCH 001/111] Add zlib1g-dev package to Airflow images (#36493)<commit_description>Seems that when mysql repository is used to install mysql client,
it induces libxml compilation for Python 3.8 and 3.9 and this
library requires devel version of zlib that is missing in the image.
This P... |
<vulnerable_code>from airflow.configuration import conf
from airflow.exceptions import AirflowException
from airflow.providers.amazon.aws.hooks.step_function import StepFunctionHook
from airflow.providers.amazon.aws.operators.base_aws import AwsBaseOperator
from airflow.providers.amazon.aws.triggers.step_function impor... |
<vulnerable_code><commit_title>[PATCH 001/111] Add zlib1g-dev package to Airflow images (#36493)<commit_description>Seems that when mysql repository is used to install mysql client,
it induces libxml compilation for Python 3.8 and 3.9 and this
library requires devel version of zlib that is missing in the image.
This P... |
<vulnerable_code>class TestStepFunctionGetExecutionOutputOperator:
TASK_ID = "step_function_get_execution_output"
def test_init(self):
op = StepFunctionGetExecutionOutputOperator(
task_id=self.TASK_ID,
)
assert op.execute(mocked_context) == expected_output
mocked_hoo... |
<vulnerable_code> self.allow_random_location_choice = allow_random_location_choice
self.create_task_kwargs = create_task_kwargs or {}
self.create_source_location_kwargs = {}
if create_source_location_kwargs:
self.create_source_location_kwargs = create_source_location_kwargs
... |
<vulnerable_code> "action_clear": "edit",
"action_clear_downstream": "edit",
"action_muldelete": "delete",
"action_set_running": "edit",
"action_set_failed": "edit",
"action_set_success": "edit",
"action_set_retry": "edit",
except Exception:
fla... |
<vulnerable_code>@pytest.mark.parametrize(
"action, expected_state",
[
("set_running", State.RUNNING),
("set_failed", State.FAILED),
("set_success", State.SUCCESS),
("set_retry", State.UP_FOR_RETRY),
("set_skipped", State.SKIPPED),
],
ids=["running", "failed", "su... |
<vulnerable_code>from uuid import uuid4
if TYPE_CHECKING:
with suppress(ImportError):
from aiobotocore.client import AioBaseClient
def __init__(
self,
aws_conn_id: str | None = AwsBaseHook.default_conn_name,
transfer_config_args: dict | None = None,
extra_args: dict | ... |
<vulnerable_code> **kwargs,
) -> None:
super().__init__(**kwargs)
if not isinstance(aws_conn_id, ArgNotSet):
warnings.warn(_DEPRECATION_MSG, AirflowProviderDeprecationWarning, stacklevel=3)
self.source_aws_conn_id = aws_conn_id
else:
self.source_aws... |
<vulnerable_code>
if TYPE_CHECKING:
from airflow.utils.context import Context
class JSONEncoder(json.JSONEncoder):
file_obj: IO,
bucket_name: str,
s3_key_prefix: str,
aws_conn_id: str | None = AwsBaseHook.default_conn_name,
) -> None:
s3_client = S3Hook(aws_conn_id=aws_conn_id).get_conn()
... |
<vulnerable_code> intersection_classes = set__exiting_classes.intersection(set__to_be_added_classes)
classes_to_create = set()
if existing == "fail" and intersection_classes:
raise ValueError(
f"Trying to create class {intersection_classes}" f" but this class already e... |
<vulnerable_code> )
if (pull or image_name) and run_in_parallel:
get_console().print(
"[error]You cannot use --pull,--image-name and --run-in-parallel at the same time. " "Exiting[/]"
)
sys.exit(1)
if run_in_parallel:<commit_title>[PATCH 001/111] Add zlib1g-dev package to ... |
<vulnerable_code> f"since you asked for it, it will be built [/]\n"
)
elif provider_metadata.get("state") == "suspended":
get_console().print(f"[warning]The package: {provider_package_id} is suspended " f"skipping it [/]\n")
raise PackageSuspendedException()
return provider_me... |
<vulnerable_code> )
else:
get_console().print(
f"[info]New version of the '{provider_package_id}' " f"package is ready to be released!\n"
)
next_version_tag = f"{HTTPS_REMOTE}/{base_branch}"
changes_table = ""
if given_answer in type_of_changes_array:
r... |
<vulnerable_code> relative_provider_path = source_provider_sources_path.relative_to(AIRFLOW_SOURCES_ROOT)
target_providers_sub_folder = target_provider_root_path / relative_provider_path
get_console().print(
f"[info]Copying provider sources: " f"{source_provider_sources_path} -> {target_providers_sub... |
<vulnerable_code> else:
if not long_form_provider.startswith(LONG_PROVIDERS_PREFIX):
raise ValueError(
f"Invalid provider name: {long_form_provider}. " f"Should start with {LONG_PROVIDERS_PREFIX}"
)
return long_form_provider[len(LONG_PROVIDERS_PREFIX) :].replac... |
<vulnerable_code> fail_pre_commit = True
console.print()
console.print(
f"[red]ERROR! The {docs_file} does not contain:\n:[/]" f"{link}\n" f"[bright_blue]Please add it!"
)
console.print()
<commit_title>[PATCH 001/111] Add zlib1g-dev package to Airflow images (#36493)<c... |
<vulnerable_code> core_dependencies = get_core_airflow_dependencies()
uninstall_all_packages(config_params)
console.print(
f"[bright_blue]Installing airflow with [{core_dependencies}] extras only " f"with eager upgrade."
)
install_local_airflow_with_eager_upgrade(
config_params, confi... |
<vulnerable_code> def test_extra_link(self):
self.assert_extra_link_url(
expected_url=(
"https://console.aws.amazon.com/batch/home" "?region=us-east-1#queues/detail/arn:fake:jq"
),
region_name="us-east-1",
aws_partition="aws",<commit_title>[PATC... |
<vulnerable_code> def test_extra_link(self):
self.assert_extra_link_url(
expected_url=(
"https://console.aws.amazon.com/emr/home" "?region=us-west-1#/clusterDetails/j-TEST-FLOW-ID"
),
region_name="us-west-1",
aws_partition="aws",
def test_ex... |
<vulnerable_code> {"id": [1, 2], "name": ["ross", "bob"], "age": ["12", "22"], "gender": ["m", "m"]}
)
with pytest.raises(
ValueError, match=r"Property 'id' already in dataset. Consider renaming or specify" r" 'uuid_column'"
):
weaviate_hook._generate_uuids(df=df, class_name="test", u... |
<vulnerable_code>
from typing import TYPE_CHECKING, Sequence
from airflow.models import BaseOperator
from airflow.providers.amazon.aws.hooks.sns import SnsHook
if TYPE_CHECKING:
from airflow.utils.context import Context
class SnsPublishOperator(BaseOperator):
"""
Publish a message to Amazon SNS.
... |
<vulnerable_code>
from unittest import mock
from airflow.providers.amazon.aws.operators.sns import SnsPublishOperator
TASK_ID = "sns_publish_job"
class TestSnsPublishOperator:
def test_init(self):
# Given / When
operator = SnsPublishOperator(
task_id=TASK_ID,
aws_conn_id=... |
<vulnerable_code>
from typing import TYPE_CHECKING, Sequence
from airflow.models import BaseOperator
from airflow.providers.amazon.aws.hooks.sqs import SqsHook
if TYPE_CHECKING:
from airflow.utils.context import Context
class SqsPublishOperator(BaseOperator):
"""
Publish a message to an Amazon SQS queue... |
<vulnerable_code>"""Reads and then deletes the message from SQS queue."""
from __future__ import annotations
from functools import cached_property
from typing import TYPE_CHECKING, Any, Collection, Sequence
from deprecated import deprecated
from airflow.configuration import conf
from airflow.exceptions import Airflow... |
<vulnerable_code> def __init__(
self,
sqs_queue: str,
aws_conn_id: str = "aws_default",
max_messages: int = 5,
num_batches: int = 1,
wait_time_seconds: int = 1,
message_filtering_config: Any = None,
delete_message_on_reception: bool = True,
wait... |
<vulnerable_code># under the License.
from __future__ import annotations
from unittest.mock import MagicMock
import pytest
from botocore.exceptions import ClientError
from moto import mock_sqs
from airflow.models.dag import DAG
from airflow.providers.amazon.aws.hooks.sqs import SqsHook
from airflow.providers.amazon.... |
<vulnerable_code>
import json
from unittest import mock
from unittest.mock import patch
import pytest
from moto import mock_sqs
from airflow.exceptions import AirflowException, AirflowSkipException, TaskDeferred
from airflow.models.dag import DAG
from airflow.providers.amazon.aws.hooks.sqs import SqsHook
from airflow... |
<vulnerable_code>TEST_MESSAGE_FILTERING_CONFIG = "test-message-filtering-config"
TEST_DELETE_MESSAGE_ON_RECEPTION = False
TEST_WAITER_DELAY = 1
trigger = SqsSensorTrigger(
sqs_queue=TEST_SQS_QUEUE,
aws_conn_id=TEST_AWS_CONN_ID,
max_messages=TEST_MAX_MESSAGES,
num_batches=TEST_NUM_BATCHES,
wait_time... |
<vulnerable_code>from diagrams import Cluster, Diagram, Edge
from diagrams.custom import Custom
from diagrams.onprem.client import User
from diagrams.onprem.database import PostgreSQL
from diagrams.programming.flowchart import MultipleDocuments
from rich.console import Console
MY_DIR = Path(__file__).parent
MY_FILENAM... |
<vulnerable_code>from diagrams import Cluster, Diagram, Edge
from diagrams.custom import Custom
from diagrams.onprem.client import User
from diagrams.onprem.database import PostgreSQL
from diagrams.programming.flowchart import MultipleDocuments
from rich.console import Console
MY_DIR = Path(__file__).parent
MY_FILENAM... |
<vulnerable_code><commit_title>[PATCH 001/111] Add zlib1g-dev package to Airflow images (#36493)<commit_description>Seems that when mysql repository is used to install mysql client,
it induces libxml compilation for Python 3.8 and 3.9 and this
library requires devel version of zlib that is missing in the image.
This P... |
<vulnerable_code> delay: float,
action: Callable,
arguments=(),
kwargs={},
):
"""Call a function at (roughly) a given interval."""
# Good enough for now
self.enter(delay, 1, repeat, args, kwargs)
self.enter(delay, 1, repeat, arguments, kwargs)... |
<vulnerable_code> session: Session = NEW_SESSION,
start_date: datetime | None = None,
end_date: datetime | None = None,
dag_ids: list[str] = [],
) -> None:
warnings.warn(
"This method is deprecated and will be removed in a future version.",<commit_title>[PATCH 001/... |
<vulnerable_code> lifecycle_config_name: str | None = None,
direct_internet_access: str | None = None,
root_access: str | None = None,
create_instance_kwargs: dict[str, Any] = {},
wait_for_completion: bool = True,
aws_conn_id: str = "aws_default",
**kwargs,
... |
<vulnerable_code> *,
function_name: str,
qualifier: str | None = None,
target_states: list = ["Active"],
**kwargs: Any,
) -> None:
super().__init__(**kwargs)
self.function_name = function_name
self.qualifier = qualifier
self.target_states = targ... |
<vulnerable_code> include_header: bool = False,
parameters: Iterable | Mapping | None = None,
table_as_file_name: bool = True, # Set to True by default for not breaking current workflows
redshift_data_api_kwargs: dict = {},
**kwargs,
) -> None:
super().__init__(**kwar... |
<vulnerable_code> autocommit: bool = False,
method: str = "APPEND",
upsert_keys: list[str] | None = None,
redshift_data_api_kwargs: dict = {},
**kwargs,
) -> None:
super().__init__(**kwargs)
self.autocommit = autocommit
self.method = method
self... |
<vulnerable_code> clear_db_sla_miss()
clear_rendered_ti_fields()
def create_dag_runs_with_mapped_tasks(self, dag_maker, session, dags={}):
for dag_id, dag in dags.items():
count = dag["success"] + dag["running"]
with dag_maker(session=session, dag_id=dag_id, start_dat... |
<vulnerable_code> max_active_tis_per_dag=16,
max_active_tis_per_dagrun=None,
pool="default_pool",
executor_config={},
trigger_rule="all_done",
on_success_callback=None,
on_execute_callback=None,
task_id=task_id,
max_active_tis_per_da... |
<vulnerable_code>from functools import wraps
from typing import TYPE_CHECKING, Callable, Sequence, TypeVar, cast
from flask import flash, redirect, render_template, request
from flask_appbuilder._compat import as_unicode
from flask_appbuilder.const import (
FLAMSG_ERR_SEC_ACCESS_DENIED,
),
... |
<vulnerable_code> result = auth.has_access_dag_entities("GET", dag_access_entity)(self.method_test)(None, items)
mock_call.assert_not_called()
assert result.status_code == 302
@pytest.mark.db_test<commit_title>[PATCH 001/111] Add zlib1g-dev package to Airflow images (#36493)<commit_descrip... |
<vulnerable_code> time.sleep(self._attempt_interval)
else:
raise error
if self.deferrable:
self.defer(
trigger=RedshiftResumeClusterTrigger(
cluster_identifier=self.cluster_identifier,
wait... |
<vulnerable_code> redshift_operator.execute(None)
assert mock_conn.resume_cluster.call_count == 10
@mock.patch.object(RedshiftHook, "conn")
def test_resume_cluster_deferrable(self, mock_conn):
"""Test Resume cluster operator deferrable"""
mock_conn.resume_cluster.return_value... |
<vulnerable_code>from airflow_breeze.utils.reinstall import reinstall_breeze, warn_dependencies_changed, warn_non_editable
from airflow_breeze.utils.shared_options import get_verbose, set_forced_answer
AIRFLOW_CFG_FILE = "setup.cfg"
def search_upwards_for_airflow_sources_root(start_from: Path) -> Path | None:
ro... |
<vulnerable_code> def get_ui_field_behaviour(cls) -> dict[str, Any]:
"""Returns custom field behaviour."""
return {
"hidden_fields": ["port", "login", "schema", "host"],
"relabeling": {
"password": "Pagerduty API token",
},
}
def __init... |
<vulnerable_code>
__all__ = ["__version__"]
__version__ = "8.15.0"
try:
from airflow import __version__ as airflow_version<commit_title>[PATCH 001/111] Add zlib1g-dev package to Airflow images (#36493)<commit_description>Seems that when mysql repository is used to install mysql client,
it induces libxml compilati... |
<vulnerable_code>
__all__ = ["__version__"]
__version__ = "4.6.0"
try:
from airflow import __version__ as airflow_version<commit_title>[PATCH 001/111] Add zlib1g-dev package to Airflow images (#36493)<commit_description>Seems that when mysql repository is used to install mysql client,
it induces libxml compilatio... |
<vulnerable_code>
__all__ = ["__version__"]
__version__ = "2.4.0"
try:
from airflow import __version__ as airflow_version<commit_title>[PATCH 001/111] Add zlib1g-dev package to Airflow images (#36493)<commit_description>Seems that when mysql repository is used to install mysql client,
it induces libxml compilatio... |
<vulnerable_code>
__all__ = ["__version__"]
__version__ = "5.5.0"
try:
from airflow import __version__ as airflow_version<commit_title>[PATCH 001/111] Add zlib1g-dev package to Airflow images (#36493)<commit_description>Seems that when mysql repository is used to install mysql client,
it induces libxml compilatio... |
<vulnerable_code>
from airflow.models.operator import Operator
from airflow.models.taskinstance import TaskInstance
class TaskReschedule(TaskInstanceDependencies):
@classmethod
def stmt_for_task_instance(
cls,
ti: TaskInstance,
*,
try_number: int | None = None,
... |
<vulnerable_code> def choose_branch(self, context: Context) -> str | Iterable[str]:
# If the DAG Run is externally triggered, then return without
# skipping downstream tasks
dag_run: DagRun = context["dag_run"]
if dag_run.external_trigger:
self.log.info("Externally trigger... |
<vulnerable_code> endpoint = conn.extra_dejson.get("endpoint", "druid/v2/sql")
return f"{conn_type}://{host}/{endpoint}"
def set_autocommit(self, conn: connect, autocommit: bool) -> NotImplementedError:
raise NotImplementedError()
def insert_rows(
commit_every: int = 1000,
... |
<vulnerable_code> )
return self._sql_conn
@overload
def run(
self,
sql: str | Iterable[str],
self.set_autocommit(conn, autocommit)
with closing(conn.cursor()) as cur:
self._run_command(cur, sql_statement, parameters)
... |
<vulnerable_code> )
return cols
@overload
def run(
self,
sql: str | Iterable[str],
with closing(conn.execute(sql_statement, parameters)) as exa_statement:
self.log.info("Running statement: %s, parameters: %s", sql_statement, parameters)
... |
<vulnerable_code> RunJobRequest,
UpdateJobRequest,
)
from google.longrunning import operations_pb2
from airflow.exceptions import AirflowException
from airflow.providers.google.common.consts import CLIENT_INFO<commit_title>[PATCH 001/111] Add zlib1g-dev package to Airflow images (#36493)<commit_description>Seem... |
<vulnerable_code> # job.result() returns a RowIterator. Mypy expects an instance of SupportsNext[Any] for
# the next() call which the RowIterator does not resemble to. Hence, ignore the arg-type error.
records = next(job.result()) # type: ignore[arg-type]
self.check_value... |
<vulnerable_code>from airflow.triggers.base import BaseTrigger, TriggerEvent
if TYPE_CHECKING:
from google.longrunning import operations_pb2
DEFAULT_BATCH_LOCATION = "us-central1"
<commit_title>[PATCH 001/111] Add zlib1g-dev package to Airflow images (#36493)<commit_description>Seems that when mysql repository is... |
<vulnerable_code>import google.auth
import google.auth.credentials
import google.oauth2.service_account
from google.auth import impersonated_credentials
from google.auth.environment_vars import CREDENTIALS, LEGACY_PROJECT, PROJECT
from airflow.exceptions import AirflowException<commit_title>[PATCH 001/111] Add zlib1g-... |
<vulnerable_code>import tenacity
from asgiref.sync import sync_to_async
from google.api_core.exceptions import Forbidden, ResourceExhausted, TooManyRequests
from google.auth import _cloud_sdk, compute_engine
from google.auth.environment_vars import CLOUD_SDK_CONFIG_DIR, CREDENTIALS
from google.auth.exceptions import Re... |
<vulnerable_code>
import google.auth.transport
from google.auth import credentials as google_auth_credentials, environment_vars, exceptions
from google.oauth2 import credentials as oauth2_credentials, service_account
if TYPE_CHECKING:
import google.oauth2
target_audience: str | None,
) -> google_auth_credentia... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.