Skip to content

Commit fa665f6

Browse files
committed
minor tweaks
1 parent bf60db4 commit fa665f6

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

sdks/python/apache_beam/yaml/yaml_transform.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1411,11 +1411,8 @@ def __init__(self, search_paths=()):
14111411
self.search_paths = list(search_paths)
14121412

14131413
def get_source(self, environment, path):
1414-
candidates = []
1415-
if FileSystems.get_scheme(path) is not None or path.startswith('/'):
1416-
candidates.append(path)
1417-
else:
1418-
candidates.append(path)
1414+
candidates = [path]
1415+
if FileSystems.get_scheme(path) is None and not path.startswith('/'):
14191416
for search_path in self.search_paths:
14201417
candidates.append(FileSystems.join(search_path, path))
14211418

@@ -1435,9 +1432,8 @@ def expand_jinja(
14351432
jinja_template: str,
14361433
jinja_variables: Mapping[str, Any],
14371434
search_paths: Iterable[str] = ()) -> str:
1438-
import apache_beam
14391435
beam_root_dir = os.path.dirname(
1440-
os.path.dirname(os.path.abspath(apache_beam.__file__)))
1436+
os.path.dirname(os.path.abspath(beam.__file__)))
14411437

14421438
all_search_paths = list(search_paths)
14431439
if beam_root_dir not in all_search_paths:

0 commit comments

Comments
 (0)