-
Notifications
You must be signed in to change notification settings - Fork 26
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
[python] Re-introduce tiledb_ctx
for SOMATileDBContext
#3335
Conversation
tiledb_ctx
for SOMATileDBContext
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3335 +/- ##
==========================================
+ Coverage 85.87% 85.89% +0.02%
==========================================
Files 55 55
Lines 6143 6176 +33
==========================================
+ Hits 5275 5305 +30
- Misses 868 871 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of issues:
- The PR is missing the
tiledb_ctx
property that was present in the API. This is the first point mentioned in the bug report. Previously it was possible to do the following:
context = soma.SOMATileDBContext()
A = tiledb.open(uri, ctx=context.tiledb_ctx)
We did deprecate this property in 1.14.5, so removing it is fair game. I'm just unsure what decision @aaronwolen took - the bug report suggests that he wanted to add both back, but I may be misreading it.
Recommend checking with him to confirm removal.
- There are some minor style/pattern comments inline.
tiledb_config: Dict[str, Union[str, float]] | None = None, | ||
tiledb_ctx: "tiledb.Ctx" | None = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tiledb_config: Dict[str, Union[str, float]] | None = None, | |
tiledb_ctx: "tiledb.Ctx" | None = None, | |
tiledb_config: Dict[str, Union[str, float]] | "tiledb.Ctx" | None = None, |
I would slightly prefer this. Admittedly passing a context to the tiledb_config
doesn't sound very good, but it eliminates the error case of passing both a context and a config. You could take a leap and say that a context is part of the "configuration".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did considering having tiledb_config
also take in a tiledb.Ctx
but decided to revert back to how we previously had it as separate arguments. But I'm open to further discussion about only having a tiledb_config
argument now.
c484029
to
17ce213
Compare
# it should be impossible to enter into this block because | ||
# we already check that in the constructor | ||
assert tiledb is not None | ||
cfg = self._tiledb_ctx().config().dict() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think _tiledb_ctx
is a method, so I suspect this should drop the parens, e.g.,
cfg = self._tiledb_ctx.config().dict()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ps. assuming my comment is correct, does this imply a missing test case? (or my comment is wrong!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right that there should not be parens.
The missing test case brings up a another issue though. We have removed all tiledb-py usage from the unit tests. But should we temporarily re-introduce it for testing with tiledb.Ctx()
? We would xskip
the test if tiledb
is not installed locally. But then do we need to install tiledb
for CI runs? (cc @johnkerl)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, tough one. I don't see any great solution - options?
The best I can come up with is:
- Code the tests to work both with and without the package installed:
- if installed, test that it works as expected
- if not installed, test that it generates the right error
- Have two CI's: one with it installed, one with it not installed
That at least mimics real-world conditions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
couple of minor suggestions/issues
257b94b
to
85f4a5d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, this is much cleaner. TY @nguyenv
Issue and/or context:
[sc-58711]
Changes:
tiledb_ctx
argumentNotes for Reviewer:
We are not reintroducing tiledb-py as a dependency. The
tiledb_ctx
is only usable when tiledb-py is installed.