Skip to content

Commit 8cf907d

Browse files
committed
chore: cleaning up python code
1 parent e49076b commit 8cf907d

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

crates/lib/src/templaters/sqruff_templaters/dbt_templater.py

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import logging
1313
import os
1414
import os.path
15-
import sys
1615
from collections import deque
1716
from contextlib import contextmanager
1817
from dataclasses import dataclass
@@ -266,14 +265,11 @@ def dbt_config(self):
266265

267266
# Attempt to silence internal logging at this point.
268267
# https://github.com/sqlfluff/sqlfluff/issues/5054
269-
print("dbt config")
270268
# self.try_silence_dbt_logs()
271269

272270
user_config = None
273271
cli_vars = self._get_cli_vars()
274272

275-
print("set user config and cli vars")
276-
277273
flags.set_from_args(
278274
DbtConfigArgs(
279275
project_dir=self.project_dir,
@@ -285,7 +281,6 @@ def dbt_config(self):
285281
),
286282
user_config,
287283
)
288-
print("flags set")
289284
_dbt_config = DbtRuntimeConfig.from_args(
290285
DbtConfigArgs(
291286
project_dir=self.project_dir,
@@ -297,10 +292,8 @@ def dbt_config(self):
297292
threads=1,
298293
)
299294
)
300-
print("dbt config set")
301295

302296
register_adapter(_dbt_config, get_mp_context())
303-
print("return dbt config")
304297
return _dbt_config
305298

306299
@cached_property
@@ -328,8 +321,6 @@ def dbt_manifest(self):
328321
# dbt 0.20.* and onward
329322
from dbt.parser.manifest import ManifestLoader
330323

331-
print(self.dbt_config)
332-
333324
return ManifestLoader.get_full_manifest(self.dbt_config)
334325

335326
@cached_property
@@ -447,10 +438,6 @@ def sequence_files(
447438
if not self.profiles_dir:
448439
self.profiles_dir = self._get_profiles_dir()
449440

450-
print("project_dir", self.project_dir)
451-
print("")
452-
print(self)
453-
454441
outs = []
455442

456443
# Populate full paths for selected files
@@ -861,15 +848,12 @@ def process_from_rust(
861848
config_string: str,
862849
live_context: Dict[str, Any],
863850
) -> TemplatedFile:
864-
print("sys.path:", sys.path)
865-
print("Current working directory:", os.getcwd())
866851
"""Process the call from the rust side."""
867852
config = fluff_config_from_json(config_string)
868853
templater = DbtTemplater(override_context=live_context, sqlfluff_config=config)
869854
try:
870855
fnames = templater.sequence_files([fname], config=config)
871856
fname = fnames[0]
872-
print(fname)
873857
(output, errors) = templater.process(
874858
in_str=string,
875859
fname=fname,
@@ -878,6 +862,7 @@ def process_from_rust(
878862
)
879863
except Exception as e:
880864
print("Error: ", e)
865+
print("Error Stack:", e.__traceback__)
881866
raise e
882867
if errors != []:
883868
raise ValueError

0 commit comments

Comments
 (0)