python_callable ) 142 res = dedent (raw_source ) 143 res = remove_task_decorator (res, self. execute (context ) 138 139 # TODO: Remove me once this provider min supported Airflow version is 2.6 140 def get_python_source (self ): 141 raw_source = inspect. environment = _b64_encode_file (input_filename ) 133 else : 134 self. environment = _b64_encode_file (script_filename ) 131 if self. This is 128 # more than slightly hacky, but it means it can work when Airflow itself is in the same Docker 129 # engine where this task is going to run (unlike say trying to mount a file in) 130 self. expect_airflow, 122 string_args_global = False, 123 ), 124 filename =script_filename, 125 ) 126 127 # Pass the python script to be executed, and the input args, via environment variables. _name _, 120 python_callable_source =py_source, 121 expect_airflow =self. get_python_source () 114 write_python_script ( 115 jinja_context = dict ( 116 op_args =self. context import Context 44 45 46 def _generate_decode_command (env_var, file, python_command ): 47 # We don't need `f.close()` as the interpreter is about to exit anyway 48 return ( 49 f ', file ) 113 py_source = self. base import TaskDecorator 43 from airflow. python_virtualenv import write_python_script 40 41 if TYPE_CHECKING : 42 from airflow. python_virtualenv import remove_task_decorator 38 39 from airflow. ![]() decorators import remove_task_decorator 34 35 # This can be removed after we move to Airflow 2.4+ 36 except ImportError : 37 from airflow. docker import DockerOperator 31 32 try : 33 from airflow. base import DecoratedOperator, task_decorator_factory 30 from airflow. 17 from _future_ import annotations 18 19 import base64 20 import inspect 21 import os 22 import pickle 23 from tempfile import TemporaryDirectory 24 from textwrap import dedent 25 from typing import TYPE_CHECKING, Callable, Sequence 26 27 import dill 28 29 from airflow. ![]() See the License for the 15 # specific language governing permissions and limitations 16 # under the License. You may obtain a copy of the License at 8 # 9 # 10 # 11 # Unless required by applicable law or agreed to in writing, 12 # software distributed under the License is distributed on an 13 # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 # KIND, either express or implied. The ASF licenses this file 5 # to you under the Apache License, Version 2.0 (the 6 # "License") you may not use this file except in compliance 7 # with the License. See the NOTICE file 3 # distributed with this work for additional information 4 # regarding copyright ownership. As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Python source code syntax highlighting (style: standard) with prefixed line numbers.Īlternatively you can here view or download the uninterpreted source code file.įor more information about "docker.py" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 2.5.3_vs_2.6.0.ġ # Licensed to the Apache Software Foundation (ASF) under one 2 # or more contributor license agreements.
0 Comments
Leave a Reply. |