Skip to content

Commit 78c1d76

Browse files
committed
Only import awkward etc. if needed
1 parent c5eeaa7 commit 78c1d76

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

code_generator_python/python_code_generator/templates/transform_single_file.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33
import time
44
from pathlib import Path
55
import generated_transformer
6-
import awkward as ak
7-
import uproot
8-
import pyarrow.parquet as pq
9-
import numpy as np
106
instance = os.environ.get('INSTANCE_NAME', 'Unknown')
117
default_tree_name = "servicex"
128
default_branch_name = "branch"
@@ -34,6 +30,11 @@ def transform_single_file(file_path: str, output_path: Path, output_format: str)
3430
wtime = time.time()
3531
total_events = 0
3632
except AttributeError:
33+
import awkward as ak
34+
import uproot
35+
import pyarrow.parquet as pq
36+
import numpy as np
37+
3738
output = generated_transformer.run_query(file_path)
3839

3940
ttime = time.time()

0 commit comments

Comments
 (0)