Skip to content

Improve versions#1973

Closed
saleweaver wants to merge 5 commits intomasterfrom
improve_versions
Closed

Improve versions#1973
saleweaver wants to merge 5 commits intomasterfrom
improve_versions

Conversation

@saleweaver
Copy link
Owner

No description provided.

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Sorry, we are unable to review this pull request

The GitHub API does not allow us to fetch diffs exceeding 20000 lines

@saleweaver
Copy link
Owner Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a2f7102897

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 20 to 39
def __call__(cls, *args: Any, **kwargs: Any):
version = kwargs.pop("version", None)

# Only dispatch for the public front class itself.
if cls.__dict__.get("_DISPATCH", False):
# Backwards-compatible default: if no version is provided, return the
# oldest supported implementation.
v_raw = version if version is not None else getattr(cls, "_DEFAULT_VERSION", None)
if v_raw is None:
return super().__call__(*args, **kwargs)

v_raw = getattr(v_raw, "value", v_raw)
v = str(v_raw)
aliases: dict[str, str] = getattr(cls, "_VERSION_ALIASES", {})
v_norm = aliases.get(v, v)

impl_map: dict[str, type] = getattr(cls, "_VERSION_MAP", {})
impl = impl_map.get(v_norm)
if impl is not None:
return impl(*args, **kwargs)

Choose a reason for hiding this comment

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

P2 Badge Preserve requested version on dispatched clients

The metaclass strips version from kwargs and instantiates the implementation class without passing it through, so Client.__init__ receives version=None. For versioned APIs that previously stored the requested version (e.g., CatalogItems/ListingsItems via self.version), CatalogItems(version="2022-04-01").version now becomes None. This is a behavioral regression for callers who introspect client.version or downstream helpers that rely on it. Consider forwarding the normalized version into the implementation constructor (or explicitly setting self.version on the concrete class) to preserve prior behavior.

Useful? React with 👍 / 👎.

Comment on lines 35 to 47
def _ensure_models_repo() -> Path:
base = Path(tempfile.gettempdir())
repo_root = base / MODELS_REPO_DIRNAME
models_dir = repo_root / "models"
if models_dir.exists():
return models_dir

subprocess.run(
["git", "clone", "--depth", "1", MODELS_REPO_URL, str(repo_root)],
check=True,
capture_output=True,
text=True,
)

Choose a reason for hiding this comment

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

P2 Badge Avoid network-dependent, unpinned model clone in tests

The test clones the models repository at HEAD on every new environment, which makes the suite nondeterministic and dependent on network availability. If the upstream repo changes (or CI runs offline), these tests can fail without any changes to this codebase. Pinning to a specific commit or vendoring the models (or caching them in-repo) would make the test stable.

Useful? React with 👍 / 👎.

@saleweaver
Copy link
Owner Author

@codex detect breaking changes

@chatgpt-codex-connector
Copy link

Summary

Testing

  • Not run (not requested).

View task →

@saleweaver
Copy link
Owner Author

@codex review commit 66489bb

@saleweaver
Copy link
Owner Author

@codex review commit f51010b

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a2f7102897

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


from sp_api.base import Client

from .finances_2024_06_01 import FinancesV20240601

Choose a reason for hiding this comment

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

P1 Badge Remove broken import or add missing finance module

This commit imports FinancesV20240601 from sp_api/api/finances/finances_2024_06_01.py, but that module is not present in the f510 tree (checked the commit’s file list via git ls-tree -r f510... and it’s absent). As a result, importing sp_api.api.finances (or the top-level sp_api.api which re-exports it) will raise an ImportError at runtime. Either add the missing module to the commit or remove the import/version entry.

Useful? React with 👍 / 👎.

saleweaver and others added 2 commits February 4, 2026 02:12
automate adding new clients,
improve documentation
@saleweaver saleweaver closed this Feb 4, 2026
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.

1 participant