Skip to content
This repository was archived by the owner on Jul 17, 2023. It is now read-only.
This repository was archived by the owner on Jul 17, 2023. It is now read-only.

Performance suggestion #57

Description

@gwillem

Thanks for making this library!

FWIW, I think it's good Python practice to not execute remote calls upon instantiating a new object. In this case, creating an API object will run 7 identical calls to /api/v2/stats via client.check_headers().

Activity

  1. skoudoro commented on Jan 23, 2023

    @skoudoro
    Owner

    Hi @gwillem,

    Thank you for your suggestion, that's a good point!

    I need to find a work around, because I still want to keep the possibility to just use Campaign object without using api object.

    Feel free to contribute if you have a good strategy. Busy week coming, so I will look into it this coming weekend

  2. gwillem commented on Jan 23, 2023

    @gwillem
    Author

    I still want to keep the possibility to just use Campaign object without using api object.

    What is your use case? Perhaps its better to split into models and verbs? It's a common design, see for example https://github.com/chargebee/chargebee-python

    Also, why are you pre-validating headers and why not just proxy the error from ML if the headers are faulty? What kind of OSError are you expecting?

    The requests module already supports put and delete functions, why duplicate them in client.py?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions