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

Pin httpx==0.23.1 to fix tests #8030

Closed
wants to merge 1 commit into from
Closed

Pin httpx==0.23.1 to fix tests #8030

wants to merge 1 commit into from

Conversation

ahuang11
Copy link
Contributor

@ahuang11 ahuang11 commented Jan 3, 2023

Since httpx==0.23.2 is raising TypeError on UUID, maybe we should pin it temporarily?
#8004 (comment)

Or perhaps the better fix is to cast the UUID into string?

Example


        # Check expected state transitions
>       states = await orion_client.read_flow_run_states(flow_run.id)

tests/test_engine.py:1101: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/prefect/client/orion.py:1589: in read_flow_run_states
    response = await self._client.get(
/opt/hostedtoolcache/Python/3.8.15/x64/lib/python3.8/site-packages/httpx/_client.py:1757: in get
    return await self.request(
/opt/hostedtoolcache/Python/3.8.15/x64/lib/python3.8/site-packages/httpx/_client.py:1520: in request
    request = self.build_request(
/opt/hostedtoolcache/Python/3.8.15/x64/lib/python3.8/site-packages/httpx/_client.py:351: in build_request
    params = self._merge_queryparams(params)
/opt/hostedtoolcache/Python/3.8.15/x64/lib/python3.8/site-packages/httpx/_client.py:428: in _merge_queryparams
    return merged_queryparams.merge(params)
/opt/hostedtoolcache/Python/3.8.15/x64/lib/python3.8/site-packages/httpx/_urls.py:723: in merge
    q = QueryParams(params)
/opt/hostedtoolcache/Python/3.8.15/x64/lib/python3.8/site-packages/httpx/_urls.py:585: in __init__
    self._dict = {
/opt/hostedtoolcache/Python/3.8.15/x64/lib/python3.8/site-packages/httpx/_urls.py:586: in <dictcomp>
    str(k): [primitive_value_to_str(item) for item in v]
/opt/hostedtoolcache/Python/3.8.15/x64/lib/python3.8/site-packages/httpx/_urls.py:586: in <listcomp>
    str(k): [primitive_value_to_str(item) for item in v]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

value = UUID('be4f74f2-8d51-4ff4-927e-707641bc498f')

    def primitive_value_to_str(value: "PrimitiveData") -> str:
        """
        Coerce a primitive data type into a string value.
    
        Note that we prefer JSON-style 'true'/'false' for boolean values here.
        """
        if value is True:
            return "true"
        elif value is False:
            return "false"
        elif value is None:
            return ""
        elif isinstance(value, (str, float, int)):
            return str(value)
>       raise TypeError(
            f"Expected str, int, float, bool, or None. Got {type(value).__name__!r}."
        )
E       TypeError: Expected str, int, float, bool, or None. Got 'UUID'.

Checklist

  • This pull request references any related issue by including "closes <link to issue>"
    • If no issue exists and your change is not a small fix, please create an issue first.
  • This pull request includes tests or only affects documentation.
  • This pull request includes a label categorizing the change e.g. fix, feature, enhancement

@ahuang11 ahuang11 requested a review from zanieb as a code owner January 3, 2023 07:31
@netlify
Copy link

netlify bot commented Jan 3, 2023

Deploy Preview for prefect-orion ready!

Name Link
🔨 Latest commit 1a9a883
🔍 Latest deploy log https://app.netlify.com/sites/prefect-orion/deploys/63b3d9f040ca0c000873ef9e
😎 Deploy Preview https://deploy-preview-8030--prefect-orion.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

httpx[http2] >= 0.23
httpx[http2] == 0.23.1 # https://github.com/PrefectHQ/prefect/pull/8004#issuecomment-1369457371
Copy link
Contributor

Choose a reason for hiding this comment

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

We should almost never pin versions — you can exclude a version e.g. != 0.23.2 if needed or add an upper bound. I think casting to strings is the correct solution here though.

@zanieb
Copy link
Contributor

zanieb commented Jan 3, 2023

Superseded by #8032

@zanieb zanieb closed this Jan 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants