prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  @spider=zabka_pl opening hours are missing Sunday data, proposed `opening_hours` are broken
  https://www.alltheplaces.xyz/map/#16.47/50.073227/20.037421
  
  ![screen](https://github.com/alltheplaces/alltheplaces/assets/899988/a19656c7-65ad-4db2-8907-b5e0f2186f26)
  
  https://www.openstreetmap.org/node/4271289403
  
  Opening hours in OSM (`Mo-Sa 06:00-22:00; Su 11:00-20:00`) are correct.
  
  At https://www.zabka.pl/znajdz-sklep it refuses to show Sunday opening hours.
  
  Maybe it is caused by their internal structure? This shops are franchises and maybe they are obligated to be open `Mo-Sa 06:00-22:00` and Sundays can be decided by operator?
  
  Overall it seems that Monday to Saturday data is likely correct.
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `locations/spiders/zabka_pl.py`
  Content:
  ```
  1 import scrapy
  2 from scrapy.http import JsonRequest
  3 
  4 from locations.dict_parser import DictParser
  5 from locations.hours import OpeningHours
  6 
  7 
  8 class ZabkaPLSpider(scrapy.Spider):
  9     name = "zabka_pl"
  10     item_attributes = {"brand": "Żabka", "brand_wikidata": "Q2589061"}
  11 
  12     # URL extracted by observing request made by Żappka Android app (using HTTP Toolkit)
  13     start_urls = ["https://partner-api.zabkamobile.pl/v2/shops"]
  14 
  15     def start_requests(self):
  16         # Authorization header is hard-coded into the Żappka app and does not appear to change (as of version 3.14.10).
  17         headers = {
  18             "Authorization": "PartnerKey 424A0B7AD0E9EA136510474D89061BBDC007B9BE5256A638EA28CC19D2BB15CD",
  19         }
  20         yield JsonRequest(url=self.start_urls[0], headers=headers)
  21 
  22     def parse(self, response):
  23         for location in response.json():
  24             item = DictParser.parse(location)
  25             item["street_address"] = item.pop("addr_full", "")
  26             # unset "state" field, it is taken from the "region" field which is some internal Żabka ID
  27             item["state"] = None
  28             item["opening_hours"] = OpeningHours()
  29 
  30             # Each franchisee is required to be open Mon-Sat with the same hours
  31             # But the hours for Sundays are set in the "nonTradingDays" field, which
  32             # contains the opening hours for each specific Sunday.
  33             item["opening_hours"].add_days_range(
  34                 ["Mo", "Tu", "We", "Th", "Fr", "Sa"], location["openTime"], location["closeTime"]
  35             )
  36             yield item
  37
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/locations/spiders/zabka_pl.py b/locations/spiders/zabka_pl.py
  --- a/locations/spiders/zabka_pl.py
  +++ b/locations/spiders/zabka_pl.py
  @@ -1,3 +1,5 @@
  +from datetime import datetime
  +
   import scrapy
   from scrapy.http import JsonRequest
   
  @@ -20,6 +22,7 @@
           yield JsonRequest(url=self.start_urls[0], headers=headers)
   
       def parse(self, response):
  +        today = datetime.now()
           for location in response.json():
               item = DictParser.parse(location)
               item["street_address"] = item.pop("addr_full", "")
  @@ -33,4 +36,25 @@
               item["opening_hours"].add_days_range(
                   ["Mo", "Tu", "We", "Th", "Fr", "Sa"], location["openTime"], location["closeTime"]
               )
  +
  +            if location["nonTradingDays"]:
  +                sunday_open = None
  +                sunday_close = None
  +                for rule in location["nonTradingDays"]:
  +                    d = datetime.strptime(rule["date"], "%Y-%m-%d")
  +                    if d.weekday() != 6 or d < today:
  +                        continue  # In the past, ignore
  +                    if sunday_open is None:
  +                        sunday_open = rule["openTime"]
  +                        sunday_close = rule["closeTime"]
  +                    else:
  +                        if sunday_open != rule["openTime"] or sunday_close != rule["closeTime"]:
  +                            self.crawler.stats.inc_value("atp/zabka_pl/nonTradingDays/mismatching")
  +                            break  # Mismatching future Sundays, skip
  +                else:
  +                    self.crawler.stats.inc_value("atp/zabka_pl/nonTradingDays/fine")
  +                    item["opening_hours"].add_range("Su", sunday_open, sunday_close)
  +            else:
  +                self.crawler.stats.inc_value("atp/zabka_pl/nonTradingDays/missing")  # Sunday closed? Missing data?
  +
               yield item
  
verification_info: {"golden_diff": "diff --git a/locations/spiders/zabka_pl.py b/locations/spiders/zabka_pl.py\n--- a/locations/spiders/zabka_pl.py\n+++ b/locations/spiders/zabka_pl.py\n@@ -1,3 +1,5 @@\n+from datetime import datetime\n+\n import scrapy\n from scrapy.http import JsonRequest\n \n@@ -20,6 +22,7 @@\n         yield JsonRequest(url=self.start_urls[0], headers=headers)\n \n     def parse(self, response):\n+        today = datetime.now()\n         for location in response.json():\n             item = DictParser.parse(location)\n             item[\"street_address\"] = item.pop(\"addr_full\", \"\")\n@@ -33,4 +36,25 @@\n             item[\"opening_hours\"].add_days_range(\n                 [\"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"], location[\"openTime\"], location[\"closeTime\"]\n             )\n+\n+            if location[\"nonTradingDays\"]:\n+                sunday_open = None\n+                sunday_close = None\n+                for rule in location[\"nonTradingDays\"]:\n+                    d = datetime.strptime(rule[\"date\"], \"%Y-%m-%d\")\n+                    if d.weekday() != 6 or d < today:\n+                        continue  # In the past, ignore\n+                    if sunday_open is None:\n+                        sunday_open = rule[\"openTime\"]\n+                        sunday_close = rule[\"closeTime\"]\n+                    else:\n+                        if sunday_open != rule[\"openTime\"] or sunday_close != rule[\"closeTime\"]:\n+                            self.crawler.stats.inc_value(\"atp/zabka_pl/nonTradingDays/mismatching\")\n+                            break  # Mismatching future Sundays, skip\n+                else:\n+                    self.crawler.stats.inc_value(\"atp/zabka_pl/nonTradingDays/fine\")\n+                    item[\"opening_hours\"].add_range(\"Su\", sunday_open, sunday_close)\n+            else:\n+                self.crawler.stats.inc_value(\"atp/zabka_pl/nonTradingDays/missing\")  # Sunday closed? Missing data?\n+\n             yield item\n", "issue": "@spider=zabka_pl opening hours are missing Sunday data, proposed `opening_hours` are broken\nhttps://www.alltheplaces.xyz/map/#16.47/50.073227/20.037421\r\n\r\n![screen](https://github.com/alltheplaces/alltheplaces/assets/899988/a19656c7-65ad-4db2-8907-b5e0f2186f26)\r\n\r\nhttps://www.openstreetmap.org/node/4271289403\r\n\r\nOpening hours in OSM (`Mo-Sa 06:00-22:00; Su 11:00-20:00`) are correct.\r\n\r\nAt https://www.zabka.pl/znajdz-sklep it refuses to show Sunday opening hours.\r\n\r\nMaybe it is caused by their internal structure? This shops are franchises and maybe they are obligated to be open `Mo-Sa 06:00-22:00` and Sundays can be decided by operator?\r\n\r\nOverall it seems that Monday to Saturday data is likely correct.\n", "before_files": [{"content": "import scrapy\nfrom scrapy.http import JsonRequest\n\nfrom locations.dict_parser import DictParser\nfrom locations.hours import OpeningHours\n\n\nclass ZabkaPLSpider(scrapy.Spider):\n    name = \"zabka_pl\"\n    item_attributes = {\"brand\": \"\u017babka\", \"brand_wikidata\": \"Q2589061\"}\n\n    # URL extracted by observing request made by \u017bappka Android app (using HTTP Toolkit)\n    start_urls = [\"https://partner-api.zabkamobile.pl/v2/shops\"]\n\n    def start_requests(self):\n        # Authorization header is hard-coded into the \u017bappka app and does not appear to change (as of version 3.14.10).\n        headers = {\n            \"Authorization\": \"PartnerKey 424A0B7AD0E9EA136510474D89061BBDC007B9BE5256A638EA28CC19D2BB15CD\",\n        }\n        yield JsonRequest(url=self.start_urls[0], headers=headers)\n\n    def parse(self, response):\n        for location in response.json():\n            item = DictParser.parse(location)\n            item[\"street_address\"] = item.pop(\"addr_full\", \"\")\n            # unset \"state\" field, it is taken from the \"region\" field which is some internal \u017babka ID\n            item[\"state\"] = None\n            item[\"opening_hours\"] = OpeningHours()\n\n            # Each franchisee is required to be open Mon-Sat with the same hours\n            # But the hours for Sundays are set in the \"nonTradingDays\" field, which\n            # contains the opening hours for each specific Sunday.\n            item[\"opening_hours\"].add_days_range(\n                [\"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"], location[\"openTime\"], location[\"closeTime\"]\n            )\n            yield item\n", "path": "locations/spiders/zabka_pl.py"}], "after_files": [{"content": "from datetime import datetime\n\nimport scrapy\nfrom scrapy.http import JsonRequest\n\nfrom locations.dict_parser import DictParser\nfrom locations.hours import OpeningHours\n\n\nclass ZabkaPLSpider(scrapy.Spider):\n    name = \"zabka_pl\"\n    item_attributes = {\"brand\": \"\u017babka\", \"brand_wikidata\": \"Q2589061\"}\n\n    # URL extracted by observing request made by \u017bappka Android app (using HTTP Toolkit)\n    start_urls = [\"https://partner-api.zabkamobile.pl/v2/shops\"]\n\n    def start_requests(self):\n        # Authorization header is hard-coded into the \u017bappka app and does not appear to change (as of version 3.14.10).\n        headers = {\n            \"Authorization\": \"PartnerKey 424A0B7AD0E9EA136510474D89061BBDC007B9BE5256A638EA28CC19D2BB15CD\",\n        }\n        yield JsonRequest(url=self.start_urls[0], headers=headers)\n\n    def parse(self, response):\n        today = datetime.now()\n        for location in response.json():\n            item = DictParser.parse(location)\n            item[\"street_address\"] = item.pop(\"addr_full\", \"\")\n            # unset \"state\" field, it is taken from the \"region\" field which is some internal \u017babka ID\n            item[\"state\"] = None\n            item[\"opening_hours\"] = OpeningHours()\n\n            # Each franchisee is required to be open Mon-Sat with the same hours\n            # But the hours for Sundays are set in the \"nonTradingDays\" field, which\n            # contains the opening hours for each specific Sunday.\n            item[\"opening_hours\"].add_days_range(\n                [\"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"], location[\"openTime\"], location[\"closeTime\"]\n            )\n\n            if location[\"nonTradingDays\"]:\n                sunday_open = None\n                sunday_close = None\n                for rule in location[\"nonTradingDays\"]:\n                    d = datetime.strptime(rule[\"date\"], \"%Y-%m-%d\")\n                    if d.weekday() != 6 or d < today:\n                        continue  # In the past, ignore\n                    if sunday_open is None:\n                        sunday_open = rule[\"openTime\"]\n                        sunday_close = rule[\"closeTime\"]\n                    else:\n                        if sunday_open != rule[\"openTime\"] or sunday_close != rule[\"closeTime\"]:\n                            self.crawler.stats.inc_value(\"atp/zabka_pl/nonTradingDays/mismatching\")\n                            break  # Mismatching future Sundays, skip\n                else:\n                    self.crawler.stats.inc_value(\"atp/zabka_pl/nonTradingDays/fine\")\n                    item[\"opening_hours\"].add_range(\"Su\", sunday_open, sunday_close)\n            else:\n                self.crawler.stats.inc_value(\"atp/zabka_pl/nonTradingDays/missing\")  # Sunday closed? Missing data?\n\n            yield item\n", "path": "locations/spiders/zabka_pl.py"}]}