Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamically determine parkserve URL #901

Merged

Conversation

nlebovits
Copy link
Collaborator

Add functionality to dynamically determine parkserve URL before loading data. Includes:

  • new function to scrape URL and download data
  • progress printing
  • unit tests

Addresses #705

Copy link

vercel bot commented Sep 19, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
vacant-lots-proj ❌ Failed (Inspect) Sep 24, 2024 1:26am

Copy link
Collaborator

@CodeWritingCow CodeWritingCow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @nlebovits "PR Checks Backend" failed due to formatting or linting issues. Can you take a look? Thanks!

Copy link
Collaborator

@zigouras zigouras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nlebovits this code looks really good. ChatGPT did exactly what I would have done in implementing the code and the unit test. The unit tests passed for me.

I wrote another unit test to test the real function, not just a mock, and renamed the mocked test:

    def test_get_latest_shapefile_url(self):
        """
        Test the get_latest_shapefile_url function.
        """
        url = get_latest_shapefile_url()
        self.assertTrue(url.startswith("https://"))
        self.assertTrue(url.endswith(".zip"))

    @patch("data_utils.park_priority.requests.get")
    def test_get_latest_shapefile_url_mock(self, mock_get):

You can add this to your test code if you want or just leave it here for informative purposes.

@zigouras zigouras linked an issue Sep 20, 2024 that may be closed by this pull request
@nlebovits nlebovits merged commit fd20fe9 into staging Sep 24, 2024
10 of 11 checks passed
@nlebovits nlebovits deleted the lebovits/issu705-dynimically-determine-parkserve-url branch September 25, 2024 01:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dynamically determine the URL of the ParkServe dataset
3 participants