Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Add xtra keyword argument or function call to MiniDataAPI Spec #466

Open
2 of 5 tasks
pydanny opened this issue Sep 25, 2024 · 1 comment
Open
2 of 5 tasks
Assignees
Labels
enhancement New feature or request

Comments

@pydanny
Copy link
Collaborator

pydanny commented Sep 25, 2024

Is your feature request related to a problem? Please describe.

The .xtra control in the MiniDataAPI spec is powerful, let's explore adding it to the spec.

Describe the solution you'd like

  • Document how the implementation should behave
  • Implement in fastlite
  • Document in the MiniDataAPI spec

Example code

Here's two ideas

  1. As a keyword argument:
todos(xtra={'name': 'Danny'})
  1. As a chainable function call:
todos(where="status='open'").xtra(name='Danny')

Similar implementations

Existing .xtra implementation is here

Problems solved

  1. Encourages safer data control practices
  2. That .xtra is immutable once set makes per-function an improvement to developer UX

Confirmation
Please confirm the following:

  • I have checked the existing issues and pull requests to ensure this feature hasn't been requested before.
  • I have read the project's documentation to ensure this feature doesn't already exist.
@pydanny pydanny added the enhancement New feature or request label Sep 25, 2024
@jph00
Copy link
Contributor

jph00 commented Sep 25, 2024

It should be a keyword argument. Search the fastlite source for anywhere we use self.xtra now, and have each of those functions take an xtra param. Then, in the function, do if not xtra: xtra=self.xtra, and then replace the usage of self.xtra in the function with xtra. Make sense?

We should implement it and use it first and see if we like it, before we document it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants