Skip to content

FIX-#7461: Set backend correctly with environment variables.#7462

Merged
sfc-gh-mvashishtha merged 6 commits intomodin-project:mainfrom
sfc-gh-mvashishtha:7461/set-backend-correctly-with-environment-variables
Mar 11, 2025
Merged

FIX-#7461: Set backend correctly with environment variables.#7462
sfc-gh-mvashishtha merged 6 commits intomodin-project:mainfrom
sfc-gh-mvashishtha:7461/set-backend-correctly-with-environment-variables

Conversation

@sfc-gh-mvashishtha
Copy link
Contributor

Prior to this commit, setting storage format and/or engine via OS environment variables would have no effect on Backend, and vice versa.

This commit overrides the get() method for Backend, StorageFormat, and Engine so that each can derive its value from the config values of its complementary variables.

…les.

Signed-off-by: sfc-gh-mvashishtha <mahesh.vashishtha@snowflake.com>
Signed-off-by: sfc-gh-mvashishtha <mahesh.vashishtha@snowflake.com>
def _warn_if_deprecated(cls) -> None:
"""Warn that the variable is deprecated if it has a deprecation descriptor."""
if cls._deprecation_descriptor is not None:
warnings.warn(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

codecov is warning that I don't have coverage for this line, but I don't think it was covered anyway. I just moved the warning code.

return _UNSET
raw = os.environ[cls.varname]
if not _TYPE_PARAMS[cls.type].verify(raw):
raise ValueError(f"Unsupported raw value: {raw}")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

codecov is warning that I haven't covered this line with a test, but I don't think we had coverage for it anyway. I moved this check here from the body of Parameter.get()

Copy link
Contributor

@sfc-gh-joshi sfc-gh-joshi left a comment

Choose a reason for hiding this comment

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

Mostly LGTM, just a couple questions.

sfc-gh-jkew
sfc-gh-jkew previously approved these changes Mar 11, 2025
Signed-off-by: sfc-gh-mvashishtha <mahesh.vashishtha@snowflake.com>
@sfc-gh-mvashishtha
Copy link
Contributor Author

Whoops @sfc-gh-joshi , I made a mistake in my last commit. I'll let you know when I've fixed it.

sfc-gh-joshi
sfc-gh-joshi previously approved these changes Mar 11, 2025
Signed-off-by: sfc-gh-mvashishtha <mahesh.vashishtha@snowflake.com>
Signed-off-by: sfc-gh-mvashishtha <mahesh.vashishtha@snowflake.com>
Copy link
Contributor

@sfc-gh-dpetersohn sfc-gh-dpetersohn left a comment

Choose a reason for hiding this comment

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

Looks good! Left a nit

Signed-off-by: sfc-gh-mvashishtha <mahesh.vashishtha@snowflake.com>
@sfc-gh-mvashishtha sfc-gh-mvashishtha merged commit 14589cd into modin-project:main Mar 11, 2025
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

4 participants