Skip to content

Commit

Permalink
Allow empty dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
Linh authored and Linh committed Aug 31, 2023
1 parent 63b1dad commit 8864088
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions etl/glean.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,14 +235,15 @@ def get_metrics(self) -> List[GleanMetric]:
for key, metricdict in data.items()
]
for dependency in self.get_dependencies():
dependency_metrics = _cache.get_json(
GleanApp.METRICS_URL_TEMPLATE.format(dependency["v1_name"])
)
# augment these dependency names with the library_name where they came from
metrics += [
(d[0], {**d[1], "origin": dependency["library_name"]})
for d in dependency_metrics.items()
]
if "v1_name" in dependency:
dependency_metrics = _cache.get_json(
GleanApp.METRICS_URL_TEMPLATE.format(dependency["v1_name"])
)
# augment these dependency names with the library_name where they came from
metrics += [
(d[0], {**d[1], "origin": dependency["library_name"]})
for d in dependency_metrics.items()
]

ping_names = set(self._get_ping_data().keys())
processed = []
Expand Down Expand Up @@ -274,15 +275,16 @@ def _get_ping_data(self) -> dict:
)

for dependency in self.get_dependencies():
dependency_pings = dict(
[
(p[0], {**p[1], "origin": dependency["library_name"]})
for p in _cache.get_json(
GleanApp.PING_URL_TEMPLATE.format(dependency["v1_name"])
).items()
]
)
ping_data.update(dependency_pings)
if "v1_name" in dependency:
dependency_pings = dict(
[
(p[0], {**p[1], "origin": dependency["library_name"]})
for p in _cache.get_json(
GleanApp.PING_URL_TEMPLATE.format(dependency["v1_name"])
).items()
]
)
ping_data.update(dependency_pings)

return ping_data

Expand Down

0 comments on commit 8864088

Please sign in to comment.