Skip to content

Commit

Permalink
Downgrade .resolve deprecation to pending; we use it in integration t…
Browse files Browse the repository at this point in the history
…ests
  • Loading branch information
mwaskom committed Jan 21, 2025
1 parent 371b98f commit ab3cb55
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions modal/_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ async def resolve(self, client: Optional[_Client] = None):
"\n\nNote that it is rarely necessary to explicitly hydrate objects, as most methods"
" will lazily hydrate when needed.",
show_source=False, # synchronicity interferes with attributing source correctly
pending=True,
)
await self.hydrate(client)

Expand Down
4 changes: 2 additions & 2 deletions test/object_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from modal import Secret
from modal._object import _Object
from modal.dict import Dict, _Dict
from modal.exception import DeprecationError, InvalidError
from modal.exception import InvalidError, PendingDeprecationError
from modal.queue import _Queue


Expand All @@ -30,7 +30,7 @@ def test_on_demand_hydration(client):
def test_resolve_deprecation(client):
obj = Dict.from_name("test-dict", create_if_missing=True)
warning = r"Please use `Dict.hydrate\(\)` or `await Dict.hydrate.aio\(\)`"
with pytest.warns(DeprecationError, match=warning):
with pytest.warns(PendingDeprecationError, match=warning):
obj.resolve(client)
assert obj.object_id is not None

Expand Down

0 comments on commit ab3cb55

Please sign in to comment.