From e37049f7f0cbc0e23d0946c4517b357c5087e9f5 Mon Sep 17 00:00:00 2001 From: Yue Shuai <48269801+yueshuaing@users.noreply.github.com> Date: Thu, 10 Oct 2024 13:57:20 -0700 Subject: [PATCH] revert the quick fix in metcouncil prerelease --- .../roadway/links/df_accessors.py | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/network_wrangler/roadway/links/df_accessors.py b/network_wrangler/roadway/links/df_accessors.py index 381c6a84..abbe1d3c 100644 --- a/network_wrangler/roadway/links/df_accessors.py +++ b/network_wrangler/roadway/links/df_accessors.py @@ -60,19 +60,19 @@ class LinkOfTypeAccessor: def __init__(self, links_df: DataFrame[RoadLinksTable]): """LinkOfTypeAccessor for RoadLinksTable.""" self._links_df = links_df - # try: - # links_df.attrs["name"] == "road_links" - # except AttributeError: - # WranglerLogger.warning( - # "`of_type` should only be used on 'road_links' dataframes. \ - # No attr['name'] not found." - # ) - # except AssertionError: - # WranglerLogger.warning( - # f"`of_type` should only be used on 'road_links' dataframes. \ - # Found type: {links_df.attr['name']}" - # ) - # raise NotLinksError("`of_type` is only available to network_links dataframes.") + try: + links_df.attrs["name"] == "road_links" + except AttributeError: + WranglerLogger.warning( + "`of_type` should only be used on 'road_links' dataframes. \ + No attr['name'] not found." + ) + except AssertionError: + WranglerLogger.warning( + f"`of_type` should only be used on 'road_links' dataframes. \ + Found type: {links_df.attr['name']}" + ) + raise NotLinksError("`of_type` is only available to network_links dataframes.") @property def managed(self):