Skip to content

'strict' argument would not be passed through to a custom provider #32

Open
@jwg4

Description

@jwg4

When setting up a custom provider, a user can supply a dict of kwargs to be passed to that class's initializer. If one of these was called 'strict', this would be dropped by the code which calls the standard FlaskRedis initializer. I see two problems with this:

  1. Someone might mistakenly pass the arg strict, intending for it to have its usual effect, as well as a custom provider. This is really a documentation/logging issue as this combination is not consistent.
  2. Someone might want to pass a keyword arg 'strict' to their custom class. This is less likely, but would be quite annoying as it would fail silently.

A couple of proposed solutions:

  • Add an assert at line 25 to check that 'strict' isn't present. This might be overkill.
  • Pass through the argument 'strict' by saving it and re-adding it. This complicates the code a bit, and doesn't help with case 1.
  • Warning but continuing.

Happy to submit a PR if given some guidance as to what is considered a good solution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions