Skip to content

Commit

Permalink
[low-code connectors] fix so we don't display yaml when debug flag is…
Browse files Browse the repository at this point in the history
… turned off (#15383)

* fix so we don't display yaml when debug is turned off

* forgot to remove old debug level
  • Loading branch information
brianjlai authored Aug 8, 2022
1 parent 55c546e commit ef712f1
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ def __init__(self, path_to_yaml):
:param path_to_yaml: Path to the yaml file describing the source
"""
self.logger = logging.getLogger(f"airbyte.{self.name}")
self.logger.setLevel(logging.DEBUG)
self._factory = DeclarativeComponentFactory()
self._path_to_yaml = path_to_yaml
self._source_config = self._read_and_parse_yaml_file(path_to_yaml)

@property
Expand All @@ -33,6 +33,11 @@ def connection_checker(self) -> ConnectionChecker:
return self._factory.create_component(check, dict())(source=self)

def streams(self, config: Mapping[str, Any]) -> List[Stream]:
self.logger.debug(
"parsed YAML into declarative source",
extra={"path_to_yaml_file": self._path_to_yaml, "source_name": self.name, "parsed_config": json.dumps(self._source_config)},
)

stream_configs = self._source_config["streams"]
for s in stream_configs:
if "class_name" not in s:
Expand All @@ -42,9 +47,4 @@ def streams(self, config: Mapping[str, Any]) -> List[Stream]:
def _read_and_parse_yaml_file(self, path_to_yaml_file):
with open(path_to_yaml_file, "r") as f:
config_content = f.read()
parsed_config = YamlParser().parse(config_content)
self.logger.debug(
"parsed YAML into declarative source",
extra={"path_to_yaml_file": path_to_yaml_file, "source_name": self.name, "parsed_config": json.dumps(parsed_config)},
)
return parsed_config
return YamlParser().parse(config_content)

0 comments on commit ef712f1

Please sign in to comment.