[Core] add deprecation warning for pydantic v1#59703
Merged
Conversation
Signed-off-by: abrar <abrar@anyscale.com>
Contributor
There was a problem hiding this comment.
Code Review
This pull request adds a deprecation warning for Pydantic v1, which is displayed during ray.init(). The implementation is correct, using log_once to show the warning only once. The warning message is clear, providing users with instructions to upgrade and a link to the relevant issue for more details. The change is well-placed and follows the existing coding style of the file. Overall, this is a solid and helpful improvement.
Signed-off-by: abrar <abrar@anyscale.com>
aslonnie
approved these changes
Dec 29, 2025
Signed-off-by: abrar <abrar@anyscale.com>
Signed-off-by: abrar <abrar@anyscale.com>
edoakes
approved these changes
Jan 7, 2026
AYou0207
pushed a commit
to AYou0207/ray
that referenced
this pull request
Jan 13, 2026
related to ray-project#58876 ```bash ❯ python -c " import ray # Temporarily patch to test the warning shows from ray._common import pydantic_compat original = pydantic_compat.IS_PYDANTIC_2 pydantic_compat.IS_PYDANTIC_2 = False # Simulate Pydantic v1 ray.init() ray.shutdown() pydantic_compat.IS_PYDANTIC_2 = original " 2025-12-26 22:33:01,387 INFO worker.py:1811 -- Connecting to existing Ray cluster at address: 172.31.7.228:6379... 2025-12-26 22:33:01,407 INFO worker.py:1991 -- Connected to Ray cluster. View the dashboard at 127.0.0.1:8265 /home/ubuntu/ray/python/ray/_private/worker.py:2039: FutureWarning: Tip: In future versions of Ray, Ray will no longer override accelerator visible devices env var if num_gpus=0 or num_gpus=None (default). To enable this behavior and turn off this error message, set RAY_ACCEL_ENV_VAR_OVERRIDE_ON_ZERO=0 warnings.warn( /home/ubuntu/ray/python/ray/_private/worker.py:2050: FutureWarning: Pydantic v1 is deprecated and will no longer be supported in Ray 2.56. Please upgrade to Pydantic v2 by running `pip install -U pydantic`. See ray-project#58876 for more details. warnings.warn( ~/ray │ on 58876-abrar-pydantic *91 " ``` --------- Signed-off-by: abrar <abrar@anyscale.com> Signed-off-by: jasonwrwang <jasonwrwang@tencent.com>
lee1258561
pushed a commit
to pinterest/ray
that referenced
this pull request
Feb 3, 2026
related to ray-project#58876 ```bash ❯ python -c " import ray # Temporarily patch to test the warning shows from ray._common import pydantic_compat original = pydantic_compat.IS_PYDANTIC_2 pydantic_compat.IS_PYDANTIC_2 = False # Simulate Pydantic v1 ray.init() ray.shutdown() pydantic_compat.IS_PYDANTIC_2 = original " 2025-12-26 22:33:01,387 INFO worker.py:1811 -- Connecting to existing Ray cluster at address: 172.31.7.228:6379... 2025-12-26 22:33:01,407 INFO worker.py:1991 -- Connected to Ray cluster. View the dashboard at 127.0.0.1:8265 /home/ubuntu/ray/python/ray/_private/worker.py:2039: FutureWarning: Tip: In future versions of Ray, Ray will no longer override accelerator visible devices env var if num_gpus=0 or num_gpus=None (default). To enable this behavior and turn off this error message, set RAY_ACCEL_ENV_VAR_OVERRIDE_ON_ZERO=0 warnings.warn( /home/ubuntu/ray/python/ray/_private/worker.py:2050: FutureWarning: Pydantic v1 is deprecated and will no longer be supported in Ray 2.56. Please upgrade to Pydantic v2 by running `pip install -U pydantic`. See ray-project#58876 for more details. warnings.warn( ~/ray │ on 58876-abrar-pydantic *91 " ``` --------- Signed-off-by: abrar <abrar@anyscale.com>
ryanaoleary
pushed a commit
to ryanaoleary/ray
that referenced
this pull request
Feb 3, 2026
related to ray-project#58876 ```bash ❯ python -c " import ray # Temporarily patch to test the warning shows from ray._common import pydantic_compat original = pydantic_compat.IS_PYDANTIC_2 pydantic_compat.IS_PYDANTIC_2 = False # Simulate Pydantic v1 ray.init() ray.shutdown() pydantic_compat.IS_PYDANTIC_2 = original " 2025-12-26 22:33:01,387 INFO worker.py:1811 -- Connecting to existing Ray cluster at address: 172.31.7.228:6379... 2025-12-26 22:33:01,407 INFO worker.py:1991 -- Connected to Ray cluster. View the dashboard at 127.0.0.1:8265 /home/ubuntu/ray/python/ray/_private/worker.py:2039: FutureWarning: Tip: In future versions of Ray, Ray will no longer override accelerator visible devices env var if num_gpus=0 or num_gpus=None (default). To enable this behavior and turn off this error message, set RAY_ACCEL_ENV_VAR_OVERRIDE_ON_ZERO=0 warnings.warn( /home/ubuntu/ray/python/ray/_private/worker.py:2050: FutureWarning: Pydantic v1 is deprecated and will no longer be supported in Ray 2.56. Please upgrade to Pydantic v2 by running `pip install -U pydantic`. See ray-project#58876 for more details. warnings.warn( ~/ray │ on 58876-abrar-pydantic *91 " ``` --------- Signed-off-by: abrar <abrar@anyscale.com>
peterxcli
pushed a commit
to peterxcli/ray
that referenced
this pull request
Feb 25, 2026
related to ray-project#58876 ```bash ❯ python -c " import ray # Temporarily patch to test the warning shows from ray._common import pydantic_compat original = pydantic_compat.IS_PYDANTIC_2 pydantic_compat.IS_PYDANTIC_2 = False # Simulate Pydantic v1 ray.init() ray.shutdown() pydantic_compat.IS_PYDANTIC_2 = original " 2025-12-26 22:33:01,387 INFO worker.py:1811 -- Connecting to existing Ray cluster at address: 172.31.7.228:6379... 2025-12-26 22:33:01,407 INFO worker.py:1991 -- Connected to Ray cluster. View the dashboard at 127.0.0.1:8265 /home/ubuntu/ray/python/ray/_private/worker.py:2039: FutureWarning: Tip: In future versions of Ray, Ray will no longer override accelerator visible devices env var if num_gpus=0 or num_gpus=None (default). To enable this behavior and turn off this error message, set RAY_ACCEL_ENV_VAR_OVERRIDE_ON_ZERO=0 warnings.warn( /home/ubuntu/ray/python/ray/_private/worker.py:2050: FutureWarning: Pydantic v1 is deprecated and will no longer be supported in Ray 2.56. Please upgrade to Pydantic v2 by running `pip install -U pydantic`. See ray-project#58876 for more details. warnings.warn( ~/ray │ on 58876-abrar-pydantic *91 " ``` --------- Signed-off-by: abrar <abrar@anyscale.com> Signed-off-by: peterxcli <peterxcli@gmail.com>
peterxcli
pushed a commit
to peterxcli/ray
that referenced
this pull request
Feb 25, 2026
related to ray-project#58876 ```bash ❯ python -c " import ray # Temporarily patch to test the warning shows from ray._common import pydantic_compat original = pydantic_compat.IS_PYDANTIC_2 pydantic_compat.IS_PYDANTIC_2 = False # Simulate Pydantic v1 ray.init() ray.shutdown() pydantic_compat.IS_PYDANTIC_2 = original " 2025-12-26 22:33:01,387 INFO worker.py:1811 -- Connecting to existing Ray cluster at address: 172.31.7.228:6379... 2025-12-26 22:33:01,407 INFO worker.py:1991 -- Connected to Ray cluster. View the dashboard at 127.0.0.1:8265 /home/ubuntu/ray/python/ray/_private/worker.py:2039: FutureWarning: Tip: In future versions of Ray, Ray will no longer override accelerator visible devices env var if num_gpus=0 or num_gpus=None (default). To enable this behavior and turn off this error message, set RAY_ACCEL_ENV_VAR_OVERRIDE_ON_ZERO=0 warnings.warn( /home/ubuntu/ray/python/ray/_private/worker.py:2050: FutureWarning: Pydantic v1 is deprecated and will no longer be supported in Ray 2.56. Please upgrade to Pydantic v2 by running `pip install -U pydantic`. See ray-project#58876 for more details. warnings.warn( ~/ray │ on 58876-abrar-pydantic *91 " ``` --------- Signed-off-by: abrar <abrar@anyscale.com> Signed-off-by: peterxcli <peterxcli@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
related to #58876