Skip to content

Commit

Permalink
Remove URLConfig warning about sorting (#1477)
Browse files Browse the repository at this point in the history
  • Loading branch information
dachengx authored Nov 16, 2024
1 parent 084a189 commit b8f3ac3
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions straxen/config/preprocessors.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,12 @@
from .config_tests import check_urls
from .url_config import URLConfig
import warnings

WARN = True


@URLConfig.preprocessor
def sort_url_kwargs(url: str):
"""Reorders queries for urlconfigs to avoid hashing issues."""

global WARN

if isinstance(url, str) and URLConfig.SCHEME_SEP in url:
if url != URLConfig.format_url_kwargs(url) and WARN:
warnings.warn(
"From straxen version 2.1.0 onward, URLConfig parameters "
"will be sorted alphabetically before being passed to the plugins, "
"this will change the lineage hash for non-sorted URLs. To load "
"data processed with non-sorted URLs, you will need to use an "
"older version."
)

WARN = False
return URLConfig.format_url_kwargs(url)
return url

Expand Down

0 comments on commit b8f3ac3

Please sign in to comment.