instance_id stringlengths 21 53 | repo stringclasses 188
values | language stringclasses 1
value | pull_number int64 20 148k | title stringlengths 6 144 | body stringlengths 0 83.4k | created_at stringdate 2015-09-25 03:17:17 2025-07-10 16:50:35 | problem_statement stringlengths 188 240k | hints_text stringlengths 0 145k | resolved_issues listlengths 1 6 | base_commit stringlengths 40 40 | commit_to_review dict | reference_review_comments listlengths 1 62 | merged_commit stringlengths 40 40 | merged_patch stringlengths 297 9.87M | metadata dict |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cython__cython-6838@8f0ce6c | cython/cython | Python | 6,838 | Fix handling of cpp_locals exception in nogil | We need to reacquire the GIL in this case (which we mostly didn't do before because it was just dealing with Python objects which always had the GIL)
Fixes #6834
Should probably wait until after 3.1 - it's a fairly niche issue (and not a regression) | 2025-05-05T09:53:28Z | [BUG] __Pyx_RaiseCppAttributeError does not acquire the GIL
### Describe your issue
This affects the cpp_locals directive. Something like
```
from libcpp.string cimport string
@cython.cpp_locals
def f():
cdef string s
with nogil:
return s=="123"
```
will cause a segmentation fault (when it should r... | [
{
"body": "### Describe your issue\n\nThis affects the cpp_locals directive. Something like\n\n```\nfrom libcpp.string cimport string\n\n@cython.cpp_locals\ndef f():\n cdef string s\n with nogil:\n return s==\"123\" \n```\n\nwill cause a segmentation fault (when it should raise an exception). Curre... | ad18cb016a78a6830c17fd9eccb1b8a68d8e5a95 | {
"head_commit": "8f0ce6c7dabb30e1320656cd85118a6457ba7587",
"head_commit_message": "Fix handling of cpp_locals exception in nogil\n\nWe need to reacquire the GIL in this case (which we mostly didn't\ndo before because it was just dealing with Python objects which\nalways had the GIL)",
"patch_to_review": "diff -... | [
{
"diff_hunk": "@@ -3239,17 +3252,15 @@ static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {\n PyErr_Format(PyExc_NameError, \"free variable '%s' referenced before assignment in enclosing scope\", varname);\n }\n \n+/////////////// RaiseClosureNameErrorNogil.proto ///////////////\n+s... | 1af88f414825ea0bee8e7b945224a0984043c7f6 | diff --git a/Cython/Compiler/Code.py b/Cython/Compiler/Code.py
index d17d8f1c011..e755602ea16 100644
--- a/Cython/Compiler/Code.py
+++ b/Cython/Compiler/Code.py
@@ -2961,34 +2961,26 @@ def put_error_if_neg(self, pos, value):
return self.putln("if (%s < 0) %s" % (value, self.error_goto(pos)))
def put_err... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "Bug Fixes"
} | |
deepset-ai__haystack-8728@8e02206 | deepset-ai/haystack | Python | 8,728 | feat: Add completion start time timestamp to relevant generators | ### Why:
Enhances Langfuse integration to track the time-to-first-token (TTFT) in streaming responses. The new entry in chat message metadata `completion_start_time` enables TTFT tracking in Langfuse. We'll separately update all other relevant generators in https://github.com/deepset-ai/haystack-core-integrations/
... | 2025-01-16T11:26:38Z | Langfuse integration: completionStartedAt is not logged, required for streaming metrics like TTFT and TPM/TPS
**Describe the bug**
When using the Langfuse integration, time to first token metrics are not available (the report I received mentioned Azure OpenAI but this might apply to all LLMs).
Langfuse supports t... | This is a bit vague as it was reported by a user but I assume the attribute is not set at all and thus it could be sufficiently detailed.
I think this would be a great addition to the integration.
Hey @marcklingen we currently [use](https://github.com/deepset-ai/haystack-core-integrations/blob/main/integrations/lang... | [
{
"body": "**Describe the bug**\r\n\r\nWhen using the Langfuse integration, time to first token metrics are not available (the report I received mentioned Azure OpenAI but this might apply to all LLMs).\r\n\r\nLangfuse supports time to first token via the “completionStartedAt” attribute on generations.\r\n\r\n*... | 62ac27c947fb9f46cac6e87999eedc3d4472e5e7 | {
"head_commit": "8e02206c19af38a9aaff3d93c230fcdd671699f2",
"head_commit_message": "Add completion_start_time timestamping to non-chat generators",
"patch_to_review": "diff --git a/haystack/components/generators/chat/hugging_face_api.py b/haystack/components/generators/chat/hugging_face_api.py\nindex 50a730a01f.... | [
{
"diff_hunk": "@@ -272,9 +275,14 @@ def _run_streaming(self, messages: List[Dict[str, str]], generation_kwargs: Dict\n \n finish_reason = choice.finish_reason\n \n- meta = {}\n- if finish_reason:\n- meta[\"finish_reason\"] = finish_reason\n+ meta = {\... | 0f13a11f395a7dfabd6f2c53fe20a0856f16b00d | diff --git a/haystack/components/generators/chat/hugging_face_api.py b/haystack/components/generators/chat/hugging_face_api.py
index 50a730a01f..1264272fca 100644
--- a/haystack/components/generators/chat/hugging_face_api.py
+++ b/haystack/components/generators/chat/hugging_face_api.py
@@ -2,6 +2,7 @@
#
# SPDX-Licens... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
deepset-ai__haystack-8794@6c32f83 | deepset-ai/haystack | Python | 8,794 | refactor: HF API Embedders - use `InferenceClient.feature_extraction` instead of `InferenceClient.post` | ### Related Issues
- fixes #8791
Our HF API Embedders support 3 different HF APIs using the `huggingface_hub` client: Serverless Inference API, Text Embeddings Inference (deployed locally or elsewhere), and HF Paid Inference Endpoints.
For several reasons, in the past we have opted to use `InferenceClient.post... | 2025-01-31T16:32:23Z | `HuggingFaceAPIDocumentEmbedder` is not compatible with `huggingface_hub>=0.28.0`
**Describe the bug**
`huggingface_hub>=0.28.0` (recently released) does not work well with our `HuggingFaceAPIDocumentEmbedder`: the final document does not contain an embedding with the expected type and size.
**To Reproduce**
```python... | [
{
"body": "**Describe the bug**\n`huggingface_hub>=0.28.0` (recently released) does not work well with our `HuggingFaceAPIDocumentEmbedder`: the final document does not contain an embedding with the expected type and size.\n\n**To Reproduce**\n```python\nfrom haystack.components.embedders import HuggingFaceAPID... | 379711f63ee8e58181194eaf58beea052723a3f4 | {
"head_commit": "6c32f8328c3e0cfd8e56737d1d90271c908a3408",
"head_commit_message": "rm unused import",
"patch_to_review": "diff --git a/haystack/components/embedders/hugging_face_api_document_embedder.py b/haystack/components/embedders/hugging_face_api_document_embedder.py\nindex 459e386976..d6d4153a19 100644\n-... | [
{
"diff_hunk": "@@ -239,18 +236,24 @@ def _embed_batch(self, texts_to_embed: List[str], batch_size: int) -> List[List[\n \"\"\"\n Embed a list of texts in batches.\n \"\"\"\n-\n all_embeddings = []\n for i in tqdm(\n range(0, len(texts_to_embed), batch_size), ... | a27287d423dd2e8c61b4ad8eca3e83cd7490baee | diff --git a/haystack/components/embedders/hugging_face_api_document_embedder.py b/haystack/components/embedders/hugging_face_api_document_embedder.py
index 459e386976..d3b92fb74c 100644
--- a/haystack/components/embedders/hugging_face_api_document_embedder.py
+++ b/haystack/components/embedders/hugging_face_api_docume... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} | |
cython__cython-6882@2e717fd | cython/cython | Python | 6,882 | Fix `__module__` attribute of shared types with metaclass | This seems the better way to do it because it doesn't impose any runtime cost to attribute lookup. It makes all of the shared types that have a `__module__` attribute inherit from a metaclass that reports the module correctly.
Supercedes https://github.com/cython/cython/pull/6845; fixes https://github.com/cython/cyt... | 2025-05-17T06:39:05Z | [BUG] Invalid `member_descriptor` as __module__ on type(cython function) under 3.1.0rc1
### Describe the bug
The `__module__` of the type of a a cython-defined function ends up as a `member_descriptor` object rather than a string. This is a regression from Cython 3.0.12.
### Code to reproduce the behaviour:
```
$ u... | This bisects to a2bd48d9e6ed02e56c8c9e2a962bb901d76a7c71.
I'll have a quick look, but it may be hard to fix.
Yeah - that's going to be hard to fix unfortunately. It looks like Python has different rules for `__module__` for heap-type and static types:
https://github.com/python/cpython/blob/1bc16504ef3866cc419f3781eef... | [
{
"body": "### Describe the bug\n\nThe `__module__` of the type of a a cython-defined function ends up as a `member_descriptor` object rather than a string. This is a regression from Cython 3.0.12.\n\n\n### Code to reproduce the behaviour:\n\n```\n$ uv pip install cython==3.1.0rc1\n$ cat t.pyx\ndef foo(x):\n r... | d640b1037827e8239f706532d7fdf25aaf4655fa | {
"head_commit": "2e717fd95e2ba83f270240b2d15d179692c9d619",
"head_commit_message": "Fix regular 3.8 build",
"patch_to_review": "diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py\nindex 43966071b21..d0420843a86 100644\n--- a/Cython/Compiler/ModuleNode.py\n+++ b/Cython/Compiler/ModuleNode.... | [
{
"diff_hunk": "@@ -2928,14 +2929,11 @@ def generate_module_state_clear(self, env, code):\n Naming.empty_bytes)\n code.putln('Py_CLEAR(clear_module_state->%s);' %\n Naming.empty_unicode)\n- code.putln('#ifdef __Pyx_CyFunction_USED')\n- code.putln('Py_CLEAR(clear_mod... | 03750724c87e07c3ac0403edccebb4accaea868f | diff --git a/Cython/Utility/AsyncGen.c b/Cython/Utility/AsyncGen.c
index 7e111dd6c25..1fa12310ec2 100644
--- a/Cython/Utility/AsyncGen.c
+++ b/Cython/Utility/AsyncGen.c
@@ -4,16 +4,16 @@
//////////////////// AsyncGenerator.module_state_decls ////////////////////
-PyTypeObject *__pyx__PyAsyncGenWrappedValueType;
-P... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "Bug Fixes"
} |
cython__cython-6580@760cf59 | cython/cython | Python | 6,580 | Fix iteration over cpp input ranges | Hello wonderful people!
This PR resolves #6578.
This change allows CppIteratorNode to insert it's own 'for' statement that uses standard C for loop capabilities.
```
from libcpp.vector cimport vector
cpdef test():
cdef vector[int] v
for i in v:
print(i)
```
Before:
```
__pyx_t_1 = ... | 2024-12-25T00:02:52Z | [BUG] 'for in' loop doesn't generate correct code for C++ ranges with input iterator category
### Describe the bug
I'm trying to write a pxd for the popular c++ simdjson library. simdjson has an `array` type with `input iterator` representing json array. I have the following code in pxd:
```
cppclass sj_arra... | [
{
"body": "### Describe the bug\r\n\r\nI'm trying to write a pxd for the popular c++ simdjson library. simdjson has an `array` type with `input iterator` representing json array. I have the following code in pxd:\r\n\r\n```\r\n cppclass sj_array_iterator \"simdjson::ondemand::array_iterator\":\r\n sj_... | 6aa305ed3011cc5466feccb609f38ad968daf134 | {
"head_commit": "760cf59087d666d5670009a21131ec846d8eb14c",
"head_commit_message": "Fix failing tests",
"patch_to_review": "diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py\nindex c931a55f583..9cc3ecc02f0 100644\n--- a/Cython/Compiler/ExprNodes.py\n+++ b/Cython/Compiler/ExprNodes.py\n@@ -... | [
{
"diff_hunk": "@@ -7707,7 +7707,8 @@ def generate_execution_code(self, code):\n code.mark_pos(self.pos)\n old_loop_labels = code.new_loop_labels()\n self.iterator.generate_evaluation_code(code)\n- code.putln(\"for (;;) {\")\n+ if not self.iterator.has_custom_for_loop:",
... | 911b35d893021f0653a89a9c729bcc6afb42e47c | diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py
index c931a55f583..3d2cf156b07 100644
--- a/Cython/Compiler/ExprNodes.py
+++ b/Cython/Compiler/ExprNodes.py
@@ -3112,6 +3112,9 @@ def generate_result_code(self, code):
if self.may_be_a_sequence:
code.putln("}")
+ def gen... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} | |
cython__cython-6829@b721b1e | cython/cython | Python | 6,829 | Add GIL-safe wrappers round many blocking C and C++ threading functions | Somewhat fixes #6826.
I still believe we're better off encouraging people to use the standard libraries rather than writing completely agnostic Cython interfaces that handle all cases (including old compilers).
What I've done:
* Added warning comments that no-one will read.
* Created py_safe functions for locki... | 2025-05-03T17:27:44Z | [ENH] single-initialization Cython API
I'd like for there to be some API or wrapper around e.g. `std::call_once` or `std::once_flag` in the C++ standard library or equivalent functionality in C23 `threads.h`. You could backfill with default implementations that use e.g. a mutex and an atomic flag for code that doesn't ... | My general advice so far to people has been to use the C++ standard library tools where available, and I've been slowly working through and making sure we have wrappings of the main ones. Both C and C++ `call_once` are now available in the main branch.
I've generally been reluctant to start implementing our own versio... | [
{
"body": "I'd like for there to be some API or wrapper around e.g. `std::call_once` or `std::once_flag` in the C++ standard library or equivalent functionality in C23 `threads.h`. You could backfill with default implementations that use e.g. a mutex and an atomic flag for code that doesn't use sufficiently new... | 5c16a696a0990b3828995b95b0c0e3f10589e441 | {
"head_commit": "b721b1ee288329775fad7f594fa504499207a6a0",
"head_commit_message": "Fixes to cnd",
"patch_to_review": "diff --git a/Cython/Includes/libc/threads.pxd b/Cython/Includes/libc/threads.pxd\nindex 6c45b7d4c04..17c6dd3ca3f 100644\n--- a/Cython/Includes/libc/threads.pxd\n+++ b/Cython/Includes/libc/thread... | [
{
"diff_hunk": "@@ -77,8 +83,152 @@ cdef extern from \"<threads.h>\" nogil:\n pass\n enum:\n TSS_DTOR_ITERATIONS\n- ctypedef void (*tss_dtor_t)(void*) nogil noexcept\n+ ctypedef void (*tss_dtor_t)(void*) noexcept nogil\n int tss_create(tss_t* key, tss_dtor_t destructor)\n void ... | e3e50d6fdb5474acd3ff1ab2d36a6de1380b5708 | diff --git a/Cython/Includes/libc/threads.pxd b/Cython/Includes/libc/threads.pxd
index 03b386b3870..fc3798a5796 100644
--- a/Cython/Includes/libc/threads.pxd
+++ b/Cython/Includes/libc/threads.pxd
@@ -1,3 +1,5 @@
+# cython: preliminary_late_includes_cy28=True
+
from libc.time cimport timespec
cdef extern from *:
@@... | {
"difficulty": "high",
"estimated_review_effort": 4,
"problem_domain": "New Feature Additions"
} |
cython__cython-6315@912ffc1 | cython/cython | Python | 6,315 | pyximport: Search also pythonpath when searching for .pyx/.py file | ~~This PR fixes only searching for .pyx files.~~
Fixes #5615
| 2024-07-31T23:11:37Z | [BUG] pyximport is ignoring `sys.path`
## Describe your issue
Consider following file tree:
```cython
########## mydir/mytest.pyx ##########
print('Hello world!')
```
Running command:
```sh
PYTHONPATH=mydir python -c 'import pyximport; pyximport.install(); import mytest'
```
from parent directory of `my... | A workaround hack is to import from the old version _pyximport2 for all python versions, e.g.
```
import pyximport._pyximport2 as pyximport
pyximport.install()
```
This is a pretty bad bug, however. | [
{
"body": "## Describe your issue\r\n\r\nConsider following file tree:\r\n```cython\r\n########## mydir/mytest.pyx ##########\r\nprint('Hello world!')\r\n```\r\n\r\nRunning command:\r\n\r\n```sh\r\nPYTHONPATH=mydir python -c 'import pyximport; pyximport.install(); import mytest'\r\n```\r\nfrom parent directory ... | 7e8a172d21b0c723be14685e25ae854bbc6cdaec | {
"head_commit": "912ffc1a9a6ca9c5a4d29fae1e68258c68f46303",
"head_commit_message": "Code style",
"patch_to_review": "diff --git a/pyximport/pyximport.py b/pyximport/pyximport.py\nindex 94f7d9dc09c..7b69db6cdc3 100644\n--- a/pyximport/pyximport.py\n+++ b/pyximport/pyximport.py\n@@ -229,7 +229,7 @@ def __init__(se... | [
{
"diff_hunk": "@@ -0,0 +1,26 @@\n+PYTHON -c \"import pyximport_test; pyximport_test.test()\"\n+\n+########## mydir/mytest.py ##########\n+\n+import cython\n+\n+test_string = \"MY_PY_TEST\"\n+compiled = cython.compiled\n+\n+######## pyximport_test.py ########\n+\n+import os\n+import sys\n+import pyximport\n+\n+... | 13e1e685b5aac8f75f0e4e4133c2b42b4515ad70 | diff --git a/pyximport/pyximport.py b/pyximport/pyximport.py
index 94f7d9dc09c..7b69db6cdc3 100644
--- a/pyximport/pyximport.py
+++ b/pyximport/pyximport.py
@@ -229,7 +229,7 @@ def __init__(self, extension=PYX_EXT, pyxbuild_dir=None, inplace=False, language
def find_spec(self, fullname, path, target=None):
... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
cython__cython-6669@41a08c5 | cython/cython | Python | 6,669 | Make CachedCFunction mechanism thread-safe | Use an atomic flag indicating the initialized-status. If in the intermediate "initializing" state then be lock-free and operate on a non-shared version instead.
On non-freethreading versions, handle the edge-case where another thread manages to initialize it while we're working (and so a reference count is lost).
... | 2025-02-13T21:47:53Z | Investigate CachedBuiltinMethod and thread safety
### Describe your issue
"Cached" makes it inherently suspicious.
Based on a quick look:
* it has three writeable parts which means there's some chance of catching it in a part-initialized state.
* There's a potential reference-counting issue on one of the parts. | [
{
"body": "### Describe your issue\n\n\"Cached\" makes it inherently suspicious.\n\nBased on a quick look:\n* it has three writeable parts which means there's some chance of catching it in a part-initialized state.\n* There's a potential reference-counting issue on one of the parts.",
"number": 6666,
"t... | 37f914bbb684d4b929580659410f8fa619515170 | {
"head_commit": "41a08c5fc18a44e6c1a6ba661c15aac18923eb3b",
"head_commit_message": "Remove pointless asserts",
"patch_to_review": "diff --git a/Cython/Utility/MemoryView_C.c b/Cython/Utility/MemoryView_C.c\nindex eb032190b86..6a8e9bab31d 100644\n--- a/Cython/Utility/MemoryView_C.c\n+++ b/Cython/Utility/MemoryVie... | [
{
"diff_hunk": "@@ -1839,9 +1884,15 @@ static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {\n if (unlikely(!unbound_method)) return -1;\n // New PyCFunction will own method reference, thus decref __Pyx_PyObject_GetAttrStr\n Py_DECREF(method);\n- ... | 82ed564da7fef7119d837a8429f570536cf4c364 | diff --git a/Cython/Utility/MemoryView_C.c b/Cython/Utility/MemoryView_C.c
index eb032190b86..6a8e9bab31d 100644
--- a/Cython/Utility/MemoryView_C.c
+++ b/Cython/Utility/MemoryView_C.c
@@ -59,6 +59,7 @@ typedef struct {
#define __pyx_atomic_sub(value, arg) atomic_fetch_sub(value, arg)
#define __pyx_atomic_int... | {
"difficulty": "high",
"estimated_review_effort": 4,
"problem_domain": "Bug Fixes"
} | |
cython__cython-6634@c1ff1fc | cython/cython | Python | 6,634 | Swap all utility code types to be heap-types/type-specs | Closes #6633 (assuming that it doesn't break anything) | 2025-01-26T15:59:48Z | [ENH?] Drop static types for Shared ABI utility code only?
### Describe your issue
I think there was a plan to eventually make all of our extension types heap types (although I'm struggling to find the issue right now...). If I remember correctly that was deferred because it wasn't possible to support all features all... | I think this is an excellent idea. They are internal classes and thus do not suffer any of the interop/subclassing issues that user defined classes may have. Simplifying their setup seems an obvious win.
That's assuming that this works. CyFunction might be limited by its need to mimic PyCFunction. But even just cleani... | [
{
"body": "### Describe your issue\n\nI think there was a plan to eventually make all of our extension types heap types (although I'm struggling to find the issue right now...). If I remember correctly that was deferred because it wasn't possible to support all features all versions of Python that we support (I... | a2bb7097e2c69d01006f6f951b596e239b16061d | {
"head_commit": "c1ff1fc7aafef04b7273d1a9beb3fe3969dbbbcf",
"head_commit_message": "Hopefully fix am_send",
"patch_to_review": "diff --git a/Cython/Utility/AsyncGen.c b/Cython/Utility/AsyncGen.c\nindex 19d4ebaf32b..c2bd7b013c6 100644\n--- a/Cython/Utility/AsyncGen.c\n+++ b/Cython/Utility/AsyncGen.c\n@@ -297,9 +2... | [
{
"diff_hunk": "@@ -1187,8 +1187,8 @@ static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key,\n #define __Pyx_pyiter_sendfunc sendfunc\n #endif\n \n-// \"Py_am_send\" requires Py3.10 when using type specs.\n-#define __PYX_HAS_PY_AM_SEND (!CYTHON_USE_TYPE_SPECS || CYTHON_USE_AM_SEND &&... | 89f78658cb67592cd9fbe9c323f03112d7d0adaa | diff --git a/Cython/Utility/AsyncGen.c b/Cython/Utility/AsyncGen.c
index 19d4ebaf32b..b914894e470 100644
--- a/Cython/Utility/AsyncGen.c
+++ b/Cython/Utility/AsyncGen.c
@@ -297,9 +297,7 @@ static PyMemberDef __Pyx_async_gen_memberlist[] = {
{"ag_await", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONL... | {
"difficulty": "high",
"estimated_review_effort": 4,
"problem_domain": "Code Refactoring / Architectural Improvement"
} |
cython__cython-6281@b983a83 | cython/cython | Python | 6,281 | Limited API call speed improvments | 1. Speed up `__Pyx_PyMethod_New` just by caching a reference to the MethodType. It's potentially called a lot so this is worthwhile.
2. Fix `__Pyx__IsSameCyOrCFunction` - this applies to the regular Cython build too (although in all cases it's only an optimization so doesn't give wrong results). It's most often called... | 2024-06-29T20:47:28Z | Limited API performance
### Describe your issue
I've been looking at the performance of the Limited API. Just a very simple test where I compile Cython with the Limited API (you need to exclude refnanny right now) and then run `time cython Cython/Compiler/ExprNodes.py`
With Python 3.12 the broad conclusion is tha... | [
{
"body": "### Describe your issue\r\n\r\nI've been looking at the performance of the Limited API. Just a very simple test where I compile Cython with the Limited API (you need to exclude refnanny right now) and then run `time cython Cython/Compiler/ExprNodes.py`\r\n\r\nWith Python 3.12 the broad conclusion is ... | 480ade314f115ff29b7eadec4d15bedbfdebf834 | {
"head_commit": "b983a83a7f2142e2028c197065573509ab8c8c63",
"head_commit_message": "Merge branch 'master' into limited-api-performance",
"patch_to_review": "diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py\nindex cc11b636103..e41641d5646 100644\n--- a/Cython/Compiler/Nodes.py\n+++ b/Cython/Compil... | [
{
"diff_hunk": "@@ -4962,14 +4962,22 @@ def generate_execution_code(self, code):\n code.putln(\"else {\")\n else:\n code.putln(\"else if (\")\n- code.putln(\"#if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY\")\n- code.putln(f\"unlikely(Py_TYPE({self_arg... | 633a52b94cfb50d07472722f6d6c94f96764b050 | diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py
index cc11b636103..c5817291be4 100644
--- a/Cython/Compiler/Nodes.py
+++ b/Cython/Compiler/Nodes.py
@@ -3423,7 +3423,9 @@ def declare_pyfunction(self, env):
if entry.is_final_cmethod and not env.parent_type.is_final_type:
err... | {
"difficulty": "high",
"estimated_review_effort": 4,
"problem_domain": "Performance Optimizations"
} | |
cython__cython-6230@e453830 | cython/cython | Python | 6,230 | Fix segfault on zero-length slice assignment on memoryview | As outlined in #6227 — we have experienced an issue in production where attempting to write a folly:IOBuf with zero-length backing buffers is triggering a SIGSEGV.
The specific issue actual has to do with how `memoryview` attempts to use scalar assignment instead of slice assignment in the case where the source buff... | 2024-06-04T19:45:25Z | [BUG] Segfault on zero-length slice assignment on memoryview
### Describe the bug
We've experienced an issue in production where attempting to write a `folly:IOBuf` with zero-length backing buffers is triggering a SIGSEGV.
We're traced this issue to the way Cython is executing zero-length slices on `cmemoryview`, ... | I think the problem is that the buffer format is `NULL`.
If that's something that Cython controls (e.g. if skips filling in the buffer format for empty slices) then it might be better to change that instead. Otherwise we need a NULL check as you suggest.
I have a repro via unit tests here: https://github.com/michael... | [
{
"body": "### Describe the bug\n\nWe've experienced an issue in production where attempting to write a `folly:IOBuf` with zero-length backing buffers is triggering a SIGSEGV. \r\n\r\nWe're traced this issue to the way Cython is executing zero-length slices on `cmemoryview`, e.g. `view[0:0]`. While this problem... | 965d7aa3485b8ba0497803c5b54cacf3f4acdbb0 | {
"head_commit": "e453830f503d3024512dc3777b95e0b9619dc987",
"head_commit_message": "Fix zero length memoryview assignment segfault by correctly using slice assignment",
"patch_to_review": "diff --git a/Cython/Utility/MemoryView.pyx b/Cython/Utility/MemoryView.pyx\nindex c3525912638..66c035e4957 100644\n--- a/Cyt... | [
{
"diff_hunk": "@@ -12,14 +12,17 @@ from cpython.ref cimport Py_INCREF, Py_DECREF, Py_CLEAR, Py_REFCNT\n cimport cython\n from cython cimport view\n from cython.view cimport array\n+from cython.view cimport memoryview\n from cython.parallel cimport prange, parallel\n-",
"line": null,
"original_line": 16... | eb47bd9d85df274fa068f8929cc2fb290ec48d49 | diff --git a/Cython/Utility/MemoryView.pyx b/Cython/Utility/MemoryView.pyx
index c3525912638..c3512f60ae6 100644
--- a/Cython/Utility/MemoryView.pyx
+++ b/Cython/Utility/MemoryView.pyx
@@ -417,7 +417,7 @@ cdef class memoryview:
if have_slices:
obj = self.is_slice(value)
- if obj:
+ ... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
cython__cython-6196@5e40e58 | cython/cython | Python | 6,196 | Handle typedefs in ufuncs | ~Extern typedefs~ Mapping of type to Numpy constant gets left to the C compiler to sort out since we can't rely on Cython having been told correctly.
Also fixes issues with using types written as `cimported_module.type` - these weren't visible in the utility code scope. Types are now declared in the utility code sco... | 2024-05-12T12:57:45Z | [BUG] numpy types cannot be used for ufunc arguments
### Describe the bug
Using numpy's C types for ufunc declarations raises a very long error.
```
Compiling /home/mnoethe/test/cython/test_numpy_ufunc.pyx because it changed.
[1/1] Cythonizing /home/mnoethe/test/cython/test_numpy_ufunc.pyx
Error compiling Cyth... | Thanks for the report. It's good to know what people are trying this and finding the obvious deficiencies :-)
It's slightly harder than it looks. Cython doesn't actually know a lot about integer typedefs - mostly just that it's "some integer" and whether it's signed or not. However, it needs to tell Numpy exactly wh... | [
{
"body": "### Describe the bug\n\nUsing numpy's C types for ufunc declarations raises a very long error.\r\n\r\n```\r\nCompiling /home/mnoethe/test/cython/test_numpy_ufunc.pyx because it changed.\r\n[1/1] Cythonizing /home/mnoethe/test/cython/test_numpy_ufunc.pyx\r\n\r\nError compiling Cython file:\r\n--------... | bc590426ced4c7d5ba0c8476e18204812e0f354a | {
"head_commit": "5e40e5838a0794765200ed0228559a3b845287d2",
"head_commit_message": "Handle typedefs in ufuncs\n\nExtern typedefs get left to the C compiler to sort out since\nwe can't rely on Cython having been told correctly.",
"patch_to_review": "diff --git a/Cython/Compiler/UFuncs.py b/Cython/Compiler/UFuncs.... | [
{
"diff_hunk": "@@ -14,6 +14,58 @@\n #define __PYX_PYUFUNCGENERICFUNCTION_CAST(x) (PyUFuncGenericFunction)x\n #endif\n \n+/////////////////////// UFuncTypeHandling.proto //////////////\n+\n+#define __PYX_GET_NPY_COMPLEX_TYPE(tp) \\\n+ sizeof(tp) == sizeof(npy_cfloat) ? NPY_CFLOAT : \\\n+ sizeof(tp) == siz... | e0f435eacf2e6958692f9240f7888a3f0fb26f87 | diff --git a/Cython/Compiler/UFuncs.py b/Cython/Compiler/UFuncs.py
index b7525679031..4abc1e47575 100644
--- a/Cython/Compiler/UFuncs.py
+++ b/Cython/Compiler/UFuncs.py
@@ -2,63 +2,14 @@
Nodes,
ExprNodes,
FusedNode,
- TreeFragment,
- Pipeline,
- ParseTreeTransforms,
Naming,
- UtilNodes,
... | {
"difficulty": "high",
"estimated_review_effort": 4,
"problem_domain": "Bug Fixes"
} |
cupy__cupy-8847@f7a900f | cupy/cupy | Python | 8,847 | Updating pylibraft `pairwise_distance` to cuvs | This PR updates cupy so that it can make use of the cuvs library for pairwise distance, which the vector search APIs from pylibraft have recently moved. This PR maintains the backwards compatibility with pylibraft while will exposing double precision float support.
Closes https://github.com/rapidsai/cuvs/issues/542 | 2024-12-19T20:12:58Z | [BUG] Update cuPy to use `cuvs.distance`
cuPy is currently using pylibraft for cuvs.distance, but the distance APIs were recently removed from `pylibraft`, which means users who have installed the latest `pylibraft` get an error. We need to update `cupy` to use `cuvs.distance`. | cc @kmaehashi for vis | [
{
"body": "cuPy is currently using pylibraft for cuvs.distance, but the distance APIs were recently removed from `pylibraft`, which means users who have installed the latest `pylibraft` get an error. We need to update `cupy` to use `cuvs.distance`. ",
"number": 542,
"title": "[BUG] Update cuPy to use `c... | 63aea1dfe1a6b9df01e23af7c38b146cd3f0ed83 | {
"head_commit": "f7a900f0c5ff14c0fb3204db11c7f22d0e8d45ce",
"head_commit_message": "Fixing style",
"patch_to_review": "diff --git a/.pfnci/linux/tests/cuda-rapids.sh b/.pfnci/linux/tests/cuda-rapids.sh\nindex 80eb9c53f39..dca5dcffa72 100644\n--- a/.pfnci/linux/tests/cuda-rapids.sh\n+++ b/.pfnci/linux/tests/cuda-... | [
{
"diff_hunk": "@@ -19,7 +19,7 @@ def create_random_kd_tree(xp, scp, n, m, n_points=1, x_offset=0, scale=10,\n \n \n @testing.with_requires('scipy')\n-@pytest.mark.skipif(not pylibraft_available, reason='pylibraft is required')\n+@pytest.mark.skipif(not cuvs_available, reason='pylibraft is required')",
"lin... | 4643b952918288b1d5bb3b2a226d5acb9b04a95b | diff --git a/.pfnci/linux/tests/cuda-rapids.Dockerfile b/.pfnci/linux/tests/cuda-rapids.Dockerfile
index e3cc4273770..e8d7fb21228 100644
--- a/.pfnci/linux/tests/cuda-rapids.Dockerfile
+++ b/.pfnci/linux/tests/cuda-rapids.Dockerfile
@@ -1,11 +1,11 @@
-ARG BASE_IMAGE="rapidsai/base:23.12-cuda12.0-py3.10"
+ARG BASE_IMAGE... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "Dependency Updates & Env Compatibility"
} |
cupy__cupy-8662@75ca814 | cupy/cupy | Python | 8,662 | Add `NCCL_ERROR_REMOTE_ERROR` to the set of errors from NCCL | Error codes possible from nccl - https://github.com/NVIDIA/nccl/blob/2ea4ee94bfb04c886c79ccae60ac9961000fdee2/src/nccl.h.in#L43
Fixes/Returns a more reasonable error for #8661 | 2024-10-14T14:43:23Z | NcclCommunicator initialization fails with KeyError: 6
### Description
NCCL communicator initialization fails with -
```
comm = nccl.NcclCommunicator(comm_size, self.nccl_comm_id, comm_rank)
File "cupy_backends/cuda/libs/nccl.pyx", line 282, in cupy_backends.cuda.libs.nccl.NcclCommunicator.__init__
File "cupy_bac... | [
{
"body": "### Description\n\nNCCL communicator initialization fails with -\n\n```\ncomm = nccl.NcclCommunicator(comm_size, self.nccl_comm_id, comm_rank)\n File \"cupy_backends/cuda/libs/nccl.pyx\", line 282, in cupy_backends.cuda.libs.nccl.NcclCommunicator.__init__\n File \"cupy_backends/cuda/libs/nccl.pyx\"... | 678add80cdd82e89f2b751f1722035c53997ad03 | {
"head_commit": "75ca814b69a82ea430536585d1e7809aae30cca3",
"head_commit_message": "cupy: add remote error to the set of errors from nccl",
"patch_to_review": "diff --git a/cupy_backends/cuda/libs/nccl.pyx b/cupy_backends/cuda/libs/nccl.pyx\nindex 1ac2c4ee006..3e1607f13fd 100644\n--- a/cupy_backends/cuda/libs/nc... | [
{
"diff_hunk": "@@ -98,6 +98,7 @@ cdef dict ERROR2 = {\n 3: 'NCCL_ERROR_INTERNAL_ERROR',\n 4: 'NCCL_ERROR_INVALID_ARGUMENT',\n 5: 'NCCL_ERROR_INVALID_USAGE',\n+ 6: 'NCCL_ERROR_REMOTE_ERROR'",
"line": null,
"original_line": 101,
"original_start_line": null,
"path": "cupy_backends/c... | 947ad95589f6df2aaa2a9bc3c30b2696304775b4 | diff --git a/cupy_backends/cuda/libs/nccl.pyx b/cupy_backends/cuda/libs/nccl.pyx
index 1ac2c4ee006..64951d9b741 100644
--- a/cupy_backends/cuda/libs/nccl.pyx
+++ b/cupy_backends/cuda/libs/nccl.pyx
@@ -98,6 +98,7 @@ cdef dict ERROR2 = {
3: 'NCCL_ERROR_INTERNAL_ERROR',
4: 'NCCL_ERROR_INVALID_ARGUMENT',
5: ... | {
"difficulty": "low",
"estimated_review_effort": 1,
"problem_domain": "Bug Fixes"
} | |
deepset-ai__haystack-8594@578ab71 | deepset-ai/haystack | Python | 8,594 | ci: add job to check imports | ### Related Issues
- fixes #8504
### Proposed Changes:
- add a new `check-imports` job to the `tests` workflow: running from hatch `default` environment (with only basic Haystack dependencies), it tries to import each package
- if everything is OK, the test passes and prints the number of imported packages
... | 2024-11-28T17:17:03Z | Add a workflow to test imports
One thing that happens often:
- we introduce a dependency in a lazy import block
- we forget to wrap types coming from the optional dependency in forward references in method signatures (`hf_output: TextGenerationStreamOutput` instead of `hf_output: "TextGenerationStreamOutput"`)
- tes... | [
{
"body": "One thing that happens often:\r\n- we introduce a dependency in a lazy import block\r\n- we forget to wrap types coming from the optional dependency in forward references in method signatures (`hf_output: TextGenerationStreamOutput` instead of `hf_output: \"TextGenerationStreamOutput\"`)\r\n- tests d... | 163c06f3d6e524384d41b5cebb6774f111766f6a | {
"head_commit": "578ab7145a8cbbd86a6833bd7a020537e2985f57",
"head_commit_message": "fix linting",
"patch_to_review": "diff --git a/.github/utils/check_imports.py b/.github/utils/check_imports.py\nnew file mode 100644\nindex 0000000000..6e1fc332f4\n--- /dev/null\n+++ b/.github/utils/check_imports.py\n@@ -0,0 +1,7... | [
{
"diff_hunk": "@@ -0,0 +1,74 @@\n+import os\n+import sys\n+import importlib\n+import traceback\n+from haystack import logging # pylint: disable=unused-import # this is needed to avoid circular imports\n+\n+def validate_package_imports(directory):",
"line": null,
"original_line": 7,
"original_star... | 0b488ca8a9a736ade775534a44a6420019f701bd | diff --git a/.github/utils/check_imports.py b/.github/utils/check_imports.py
new file mode 100644
index 0000000000..6867199a05
--- /dev/null
+++ b/.github/utils/check_imports.py
@@ -0,0 +1,74 @@
+import os
+import sys
+import importlib
+import traceback
+from haystack import logging # pylint: disable=unused-import # ... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Test Suite / CI Enhancements"
} | |
deepset-ai__haystack-8617@ed47997 | deepset-ai/haystack | Python | 8,617 | !feat: unify NLTKDocumentSplitter and DocumentSplitter | ### Related Issues
- fixes #8600
### Proposed Changes:
- Refactor the DocumentSplitter to have 3 main splitting cases: by character, by function and by the new custom sentence tokenizer based on NLTK
### How did you test it?
- merged tests from NLTKDocumenSplitter, removed duplicated ones and added new ... | 2024-12-09T15:51:52Z | Unify `DocumentSplitter` and `NLTKDocumentSplitter`
These two classes are very much alike. The only difference is that the `NLTKDocumentSplitter` uses NLTK's sentence boundary detection algorithm. We should merge those two into one single component.
It could still be possible to give the user the choice to either use... | [
{
"body": "These two classes are very much alike. The only difference is that the `NLTKDocumentSplitter` uses NLTK's sentence boundary detection algorithm. We should merge those two into one single component.\n\nIt could still be possible to give the user the choice to either use a naive approach for sentence b... | 04fc187bc44c39fcd5d8c29ce7f27f91667065ce | {
"head_commit": "ed4799706280dccec4495a4ac1a9626822d402b6",
"head_commit_message": "fixing LICENSE header",
"patch_to_review": "diff --git a/haystack/components/preprocessors/document_splitter.py b/haystack/components/preprocessors/document_splitter.py\nindex 86d95f412a..de2a041737 100644\n--- a/haystack/compone... | [
{
"diff_hunk": "@@ -54,40 +54,115 @@ class DocumentSplitter:\n \n def __init__( # pylint: disable=too-many-positional-arguments\n self,\n- split_by: Literal[\"function\", \"page\", \"passage\", \"sentence\", \"word\", \"line\"] = \"word\",\n+ split_by: Literal[\"function\", \"page\", ... | a82614e850c6829194d8e9587d7e34069e1748ec | diff --git a/haystack/components/preprocessors/document_splitter.py b/haystack/components/preprocessors/document_splitter.py
index 86d95f412a..b3e99924a7 100644
--- a/haystack/components/preprocessors/document_splitter.py
+++ b/haystack/components/preprocessors/document_splitter.py
@@ -2,20 +2,21 @@
#
# SPDX-License-... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "Code Refactoring / Architectural Improvement"
} | |
cython__cython-6088@f04b353 | cython/cython | Python | 6,088 | Improve performance hints for nogil + pxd | In order to be called efficiently, these functions must have the exception specification set in the pxd file since Cython is unable to assume an implicit exception specification.
This improves the quality of the messages to draw attention to this detail.
Closes #6001 | 2024-03-16T16:40:46Z | [BUG] Getting "performance hint: ..."
### Describe the bug
I keep getting these "performance hint" bellow.
Goal is to run `io_uring_queue_init` with `nogil`, since nogil required other functions to be nogil as well I have set `trap_error` to be `nogil` as well and only trigger error when return value is `< 0`, why ... | I can't reproduce with the code given here. To make it compile I slightly modified it to the below:
```
# liburing.pyx
from error cimport trap_error
cpdef int io_uring_queue_init(int x) nogil:
return trap_error(x)
```
```
# error.pxd
cpdef int trap_error(int no) nogil
```
```
# error.pyx
... | [
{
"body": "### Describe the bug\n\nI keep getting these \"performance hint\" bellow.\r\n\r\nGoal is to run `io_uring_queue_init` with `nogil`, since nogil required other functions to be nogil as well I have set `trap_error` to be `nogil` as well and only trigger error when return value is `< 0`, why `with gil:`... | 7484c01022c33af0754d991e24af1fdf0487ecb0 | {
"head_commit": "f04b3533ec4e3917aebbe6b8bb0861fc15616ea8",
"head_commit_message": "Fix code style",
"patch_to_review": "diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py\nindex cb1565536c8..5dfef749f1d 100644\n--- a/Cython/Compiler/ExprNodes.py\n+++ b/Cython/Compiler/ExprNodes.py\n@@ -651... | [
{
"diff_hunk": "@@ -41,6 +41,12 @@ cpdef void release_gil_in_nogil2() nogil:\n with nogil:\n pass\n \n+cdef int f_in_pxd1() nogil except -1:\n+ return 0\n+\n+cdef int f_in_pxd2() nogil: # implicit except -1?\n+ return 0\n+",
"line": null,
"original_line": 49,
"original_start_line"... | 1e2005dca0bc36cb5f157750a33cf942593a3f97 | diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py
index cb1565536c8..5dfef749f1d 100644
--- a/Cython/Compiler/ExprNodes.py
+++ b/Cython/Compiler/ExprNodes.py
@@ -6511,7 +6511,8 @@ def generate_result_code(self, code):
PyrexTypes.write_noexcept_performance_hint(
... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "Bug Fixes"
} |
deepset-ai__haystack-8585@362b898 | deepset-ai/haystack | Python | 8,585 | feat: Add store_full_path to converters (3/3) | ### Related Issues
- fixes #8440
### Proposed Changes:
This PR is similar to #8566 , #8573
Add a new parameter to the `__init__ `method to allow users to toggle whether the `file_path` in metadata stores the complete file path or only the base file name. A `DeprecationWarning` is generated about the upcomi... | 2024-11-26T14:13:41Z | File_path in meta should optionally be just the filename
When indexing, file_path currently passed to meta contains the absolute path used as the source.
This potentially leads to a situation where full paths containing usernames are then stored in a document store, e.g.,
```
-0.013439087197184563,
... | [
{
"body": "When indexing, file_path currently passed to meta contains the absolute path used as the source.\r\n\r\nThis potentially leads to a situation where full paths containing usernames are then stored in a document store, e.g.,\r\n\r\n```\r\n -0.013439087197184563,\r\n -0.05053149536... | de7099e5605fb89d8bca4623dc339bdacc7e18bb | {
"head_commit": "362b898eaee424e8c82423dda24a5433f199f233",
"head_commit_message": "Lint fix",
"patch_to_review": "diff --git a/haystack/components/converters/azure.py b/haystack/components/converters/azure.py\nindex 94ca9714f3..edcc348d84 100644\n--- a/haystack/components/converters/azure.py\n+++ b/haystack/com... | [
{
"diff_hunk": "@@ -0,0 +1,8 @@\n+---\n+features:\n+ - |\n+ Added a new `store_full_path` parameter to the `__init__` methods of `PyPDFToDocument` and `AzureOCRDocumentConverter`. The default value is `True`, which stores full file path in the metadata of the output documents. When set to `False`, only the ... | 979ceb937063694865887367692054e8d5d2f7f4 | diff --git a/haystack/components/converters/azure.py b/haystack/components/converters/azure.py
index 94ca9714f3..edcc348d84 100644
--- a/haystack/components/converters/azure.py
+++ b/haystack/components/converters/azure.py
@@ -4,6 +4,8 @@
import copy
import hashlib
+import os
+import warnings
from collections impo... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "New Feature Additions"
} | |
cython__cython-6065@b76097c | cython/cython | Python | 6,065 | Make UtilityCode.__eq__ account for "init" section | Fixes #6064. The relevant utility code to set up ufuncs wasn't being included because it compared equal to a different section of utility code that also only contained an init section | 2024-03-09T09:08:15Z | [BUG] Access violation using cython.ufunc with cimport numpy
### Describe the bug
The following code using `@cython.ufunc`, a slight variation of the documentation, crashes reproducibly on import on Windows with Python 3.11/3.12, Cython 3.0.9/3.1.0a0, numpy 1.26.4, Visual Studio 2022, and `define_macros=[("NPY_NO_DEPR... | Adding these lines at the top of the .pyx before any other code seems to work reliable for me:
```cython
cimport numpy
numpy.import_array()
numpy.import_ufunc()
```
So the issue seems to be: using `cython.ufunc` is supposed to add this utility code https://github.com/cython/cython/blob/6aeecdec5a0aa851e941eb7e0186... | [
{
"body": "### Describe the bug\n\nThe following code using `@cython.ufunc`, a slight variation of the documentation, crashes reproducibly on import on Windows with Python 3.11/3.12, Cython 3.0.9/3.1.0a0, numpy 1.26.4, Visual Studio 2022, and `define_macros=[(\"NPY_NO_DEPRECATED_API\", \"NPY_1_7_API_VERSION\")]... | 4bc10b9f41c29cfc8c093b6d7c2505894c6e40ca | {
"head_commit": "b76097c8263b1455fbfb9a3bd6f568d64693b1b3",
"head_commit_message": "Move test",
"patch_to_review": "diff --git a/Cython/Compiler/Code.py b/Cython/Compiler/Code.py\nindex 8fb488f588d..cd1c0a1f0f7 100644\n--- a/Cython/Compiler/Code.py\n+++ b/Cython/Compiler/Code.py\n@@ -450,6 +450,9 @@ def format_c... | [
{
"diff_hunk": "@@ -450,6 +450,9 @@ def format_code(self, code_string, replace_empty_lines=re.compile(r'\\n\\n+').sub)\n def __str__(self):\n return \"<%s(%s)>\" % (type(self).__name__, self.name)\n \n+ def __repr__(self):\n+ return str(self)",
"line": null,
"original_line": 454,
... | 512bf8d45572af3d96910218b67b6b7e87276578 | diff --git a/Cython/Compiler/Code.py b/Cython/Compiler/Code.py
index 8fb488f588d..915bcfc948d 100644
--- a/Cython/Compiler/Code.py
+++ b/Cython/Compiler/Code.py
@@ -447,7 +447,7 @@ def format_code(self, code_string, replace_empty_lines=re.compile(r'\n\n+').sub)
code_string = replace_empty_lines('\n', code_... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
deepset-ai__haystack-8568@32881cd | deepset-ai/haystack | Python | 8,568 | feat: Add variable to specify inputs as optional to ConditionalRouter | ## Why:
Enhances the ConditionalRouter component by adding support for optional parameters, enabling default/fallback routing behavior when certain inputs are not provided at runtime.
- fixes https://github.com/deepset-ai/haystack/issues/8556
## What:
Introduces `optional_variables` parameter to specify which... | 2024-11-22T10:33:39Z | Add variable to specify inputs as optional to ConditionalRouter
**Is your feature request related to a problem? Please describe.**
We are using a conditional router to route to different pipeline branches based on a parameter we insert during runtime. We would like to also set a default branch in case the respective p... | [
{
"body": "**Is your feature request related to a problem? Please describe.**\r\nWe are using a conditional router to route to different pipeline branches based on a parameter we insert during runtime. We would like to also set a default branch in case the respective parameter (path) was not inserted at runtime... | 0b2a299378e6eeb45c275f4dc4b1f7a1b307b34d | {
"head_commit": "32881cd8d79b28fc1d9e858e14c715cd6a51f7d3",
"head_commit_message": "Add pylint disable=too-many-positional-arguments",
"patch_to_review": "diff --git a/haystack/components/routers/conditional_router.py b/haystack/components/routers/conditional_router.py\nindex 27312f43a1..020fdc3e9b 100644\n--- a... | [
{
"diff_hunk": "@@ -136,11 +137,49 @@ def __init__(\n :param validate_output_type:\n Enable validation of routes' output.\n If a route output doesn't match the declared type a ValueError is raised running.\n+ :param optional_variables:\n+ A list of variable name... | 6650c988931f0604b16d5bd2fee3e6e6fc659faf | diff --git a/haystack/components/routers/conditional_router.py b/haystack/components/routers/conditional_router.py
index 27312f43a1..5fbe399248 100644
--- a/haystack/components/routers/conditional_router.py
+++ b/haystack/components/routers/conditional_router.py
@@ -107,12 +107,13 @@ class ConditionalRouter:
```
... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "New Feature Additions"
} | |
cython__cython-5999@80003ef | cython/cython | Python | 5,999 | Warn when function returning python object is marked as noexcept | Fixes #5661
| 2024-02-13T20:19:15Z | [BUG] Warn when noexcept is ignored
### Describe the bug
We should warn when `noexcept` is ignored - just to stop people thinking they're optimizing something that they aren't
### Code to reproduce the behaviour:
```cython
cdef object xx() noexcept:
pass
```
This also applies to memoryviews
### Expected b... | Should also obviously only apply to a manual noexcept, not an implicit noexcept
Just a thought. Why not directly generate an error? When an object is returned the `noexcept` is not correctly used.
I just want to add the context of my stackoverflow question that lead to this issue:
https://stackoverflow.com/questions... | [
{
"body": "### Describe the bug\n\nWe should warn when `noexcept` is ignored - just to stop people thinking they're optimizing something that they aren't\n\n### Code to reproduce the behaviour:\n\n```cython\r\ncdef object xx() noexcept:\r\n pass\r\n```\r\n\r\nThis also applies to memoryviews\n\n### Expected ... | e9b08d3f071ebfad7f4886e43173cd0f72df6676 | {
"head_commit": "80003ef01a58346a455ac909a60a3f2544bf3f2b",
"head_commit_message": "Warn only when noexcept is explicitly declared",
"patch_to_review": "diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py\nindex de3a9464b0b..2185cd447a4 100644\n--- a/Cython/Compiler/Nodes.py\n+++ b/Cython/Compiler/N... | [
{
"diff_hunk": "@@ -625,6 +625,7 @@ class CFuncDeclaratorNode(CDeclaratorNode):\n # has_varargs boolean\n # exception_value ConstNode or NameNode NameNode when the name of a c++ exception conversion function\n # exception_check boolean or \"+\" True if PyErr_Occurred check needed, \"+\"... | 748c0b3c4ede813007d24afc85aacdf96194522b | diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py
index e86bcfd609b..03cbc24fab3 100644
--- a/Cython/Compiler/Nodes.py
+++ b/Cython/Compiler/Nodes.py
@@ -619,15 +619,16 @@ def analyse(self, base_type, env, nonempty=0, visibility=None, in_pxd=False):
class CFuncDeclaratorNode(CDeclaratorNode):
- #... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
deepset-ai__haystack-8544@1af60ec | deepset-ai/haystack | Python | 8,544 | fix: append runtime meta to ChatMessage's extracted meta in AnswerBuilder | ### Related Issues
- fixes #8542
### Proposed Changes:
We were ignoring the runtime meta parameter. Now we explicitly merge it.
### How did you test it?
Added a couple of tests that varied how meta was provided (runtime, in ChatMessage, in both, etc).
### Notes for the reviewer
### Checklist
-... | 2024-11-14T01:26:04Z | bug: Runtime meta parameter is ignored in AnswerBuilder
**Describe the bug**
When using an `AnswerBuilder` after a `ChatGenerator` I am also passing meta information to the `AnswerBuilder`. However, when I do this noticed that the meta information I pass is ignored.
Here is an example piece of code
```python
fro... | I see what I did wrong. I can fix this. | [
{
"body": "**Describe the bug**\r\nWhen using an `AnswerBuilder` after a `ChatGenerator` I am also passing meta information to the `AnswerBuilder`. However, when I do this noticed that the meta information I pass is ignored. \r\n\r\nHere is an example piece of code\r\n```python\r\nfrom haystack import Pipeline\... | 2cc45dd5b9d8c0e9c326a0022f0c2f3775939313 | {
"head_commit": "1af60ec5fc3f78a72c810214b00b0f9fca45a85c",
"head_commit_message": "add pylint ignore flag to .run()",
"patch_to_review": "diff --git a/haystack/components/builders/answer_builder.py b/haystack/components/builders/answer_builder.py\nindex 1577fb3e99..859400c58e 100644\n--- a/haystack/components/b... | [
{
"diff_hunk": "@@ -111,10 +111,13 @@ def run(\n pattern = pattern or self.pattern\n reference_pattern = reference_pattern or self.reference_pattern\n all_answers = []\n- for reply, metadata in zip(replies, meta):\n+ for reply, given_metadata in zip(replies, meta):\n ... | fa3744673bc540a3525e7468dfc7988a7cc50415 | diff --git a/haystack/components/builders/answer_builder.py b/haystack/components/builders/answer_builder.py
index 1577fb3e99..b89d506aec 100644
--- a/haystack/components/builders/answer_builder.py
+++ b/haystack/components/builders/answer_builder.py
@@ -58,7 +58,7 @@ def __init__(self, pattern: Optional[str] = None, r... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
deepset-ai__haystack-8500@3452ba2 | deepset-ai/haystack | Python | 8,500 | feat: Add route output type validation in `ConditionalRouter` | ### Related Issues
- fixes #8445
### Proposed Changes:
Add routes output type validation in `ConditionalRouter`.
To enable instantiate `ConditionalRouter` with `validate_output_type=True`.
### How did you test it?
Added new tests.
### Notes for the reviewer
N/A
### Checklist
- I have read ... | 2024-10-29T15:05:56Z | Update `ConditionalRouter.run` method to check the rendered output matches the defined output_type
I really like the `ConditionalRouter` since it enables a lot of agentic type use cases. However, it can be a little difficult to use since it relies on good knowledge of Jinja2 syntax and I have found in practice it's ver... | [
{
"body": "I really like the `ConditionalRouter` since it enables a lot of agentic type use cases. However, it can be a little difficult to use since it relies on good knowledge of Jinja2 syntax and I have found in practice it's very easy to make mistakes and errors. So to partially help this process I think it... | 820572439553ca2d2b51cb567f1f75e2527b67b9 | {
"head_commit": "3452ba2c451a9225e0690eddbd2ec2aa050665d3",
"head_commit_message": "Fix error string",
"patch_to_review": "diff --git a/haystack/components/routers/conditional_router.py b/haystack/components/routers/conditional_router.py\nindex b16ae3d342..7889ec740a 100644\n--- a/haystack/components/routers/con... | [
{
"diff_hunk": "@@ -288,3 +311,53 @@ def _validate_template(self, env: Environment, template_text: str):\n return True\n except TemplateSyntaxError:\n return False\n+\n+ def _output_matches_type(self, value: Any, expected_type: type): # noqa: PLR0911",
"line": null,
"... | 9d8248b437ef139a4726f0477873df36108df292 | diff --git a/haystack/components/routers/conditional_router.py b/haystack/components/routers/conditional_router.py
index b16ae3d342..27312f43a1 100644
--- a/haystack/components/routers/conditional_router.py
+++ b/haystack/components/routers/conditional_router.py
@@ -4,7 +4,7 @@
import ast
import contextlib
-from ty... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "New Feature Additions"
} | |
deepset-ai__haystack-8463@6e6ce67 | deepset-ai/haystack | Python | 8,463 | fix: window_size set during run instead of construction | ### Related Issues
- fixes #8459
### Proposed Changes:
<!--- In case of a bug: Describe what caused the issue and how you solved it -->
<!--- In case of a feature: Describe what did you add and how it works -->
### How did you test it?
<!-- unit tests, integration tests, manual verification, instructi... | 2024-10-17T13:48:16Z | Make `window_size` a runtime option for `SentenceWindowRetriever`
**Is your feature request related to a problem? Please describe.**
Currently, `window_size` is only provided at initialization. There is no need for this. Ideally, we can allow users to decide the size of the window at runtime, allowing them to change i... | [
{
"body": "**Is your feature request related to a problem? Please describe.**\r\nCurrently, `window_size` is only provided at initialization. There is no need for this. Ideally, we can allow users to decide the size of the window at runtime, allowing them to change it when we call `pipeline.run()`.\r\n\r\n**Des... | 0157459a7b9b2549dec5d89b8208b7573c949946 | {
"head_commit": "6e6ce6752761727662901d92142c42f8f3d958d5",
"head_commit_message": "Merge branch 'main' into remove_window_size_from_init",
"patch_to_review": "diff --git a/haystack/components/retrievers/sentence_window_retriever.py b/haystack/components/retrievers/sentence_window_retriever.py\nindex abc68850c1.... | [
{
"diff_hunk": "@@ -161,6 +163,10 @@ def run(self, retrieved_documents: List[Document]):\n `retrieved_documents`.\n \n \"\"\"\n+ current_window_size = window_size if window_size is not None else self.window_size\n+\n+ if current_window_size < 1:",
"... | cd7d006583899a203b982f7be5c9c2288c569715 | diff --git a/haystack/components/retrievers/sentence_window_retriever.py b/haystack/components/retrievers/sentence_window_retriever.py
index abc68850c1..fbc389ed3e 100644
--- a/haystack/components/retrievers/sentence_window_retriever.py
+++ b/haystack/components/retrievers/sentence_window_retriever.py
@@ -2,7 +2,7 @@
... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "New Feature Additions"
} | |
cupy__cupy-8219@99189d5 | cupy/cupy | Python | 8,219 | add `cudaStreamCreateWithPriority` | This PR aims to close #8210 by adding the `cudaStreamCreateWithPriority` API. | 2024-03-01T14:57:14Z | Support Cuda Stream creation with Priority
### Description
Hi,
It appears that CuPy does not support the creation of custom CUDA streams with priority. Since the API for this functionality is already available in CUDA, it would be very helpful if CuPy provided this feature.
Thanks
### Additional Information
_N... | As a workaround, you can access the `cudaStreamCreateWithPriority` API through CUDA Python (need to install it yourself via `pip` or `conda`)
https://nvidia.github.io/cuda-python/module/cudart.html?highlight=cudastreamcreatewithpriority#cuda.cudart.cudaStreamCreateWithPriority
and wrap the returned pointer with `Exte... | [
{
"body": "### Description\n\nHi,\r\n\r\nIt appears that CuPy does not support the creation of custom CUDA streams with priority. Since the API for this functionality is already available in CUDA, it would be very helpful if CuPy provided this feature.\r\n\r\nThanks\n\n### Additional Information\n\n_No response... | 8fb6d0412908ebb8f73d81106cc0bcccb9cb49c8 | {
"head_commit": "99189d5f9ccf11df827186549b12274533a6f334",
"head_commit_message": "fixed typo",
"patch_to_review": "diff --git a/cupy/cuda/stream.pyx b/cupy/cuda/stream.pyx\nindex 96e34e6618f..73cd7c6f416 100644\n--- a/cupy/cuda/stream.pyx\n+++ b/cupy/cuda/stream.pyx\n@@ -423,6 +423,38 @@ class _BaseStream:\n ... | [
{
"diff_hunk": "@@ -423,6 +423,38 @@ class _BaseStream:\n except RuntimeError: # can be RuntimeError or CUDARuntimeError\n raise\n \n+ def get_stream_flags(self):\n+ \"\"\"Query the flags of a stream.\n+\n+ Returns:\n+ bool:\n+ The return value is ... | f7d162a3e15330a74693f6c6276804787b632442 | diff --git a/cupy/cuda/stream.pyx b/cupy/cuda/stream.pyx
index 96e34e6618f..eb8ed8d1a17 100644
--- a/cupy/cuda/stream.pyx
+++ b/cupy/cuda/stream.pyx
@@ -423,6 +423,21 @@ class _BaseStream:
except RuntimeError: # can be RuntimeError or CUDARuntimeError
raise
+ @property
+ def is_non_blocki... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "New Feature Additions"
} |
deepset-ai__haystack-8457@2dd3777 | deepset-ai/haystack | Python | 8,457 | feat: DOCXToDocument: add table extraction | ### Why:
Enhances functionality for converting DOCX documents by improving the extraction of document elements, including tables, while maintaining page breaks. This addresses limitations in accurately capturing the structured content of DOCX files for further processing.
- fixes https://github.com/deepset-ai/hayst... | 2024-10-15T12:58:34Z | feat: Add table extraction in`DOCXToDocument`
**Is your feature request related to a problem? Please describe.**
The current version of the `DOCXToDocument` does not extract tables from `docx` documents.
**Describe the solution you'd like**
Ability to extract tables from documents while preserving their original... | @julian-risch I'll self assigned this one coordinating with @medsriha
@medsriha and @sjrl if we iterate over document elements:
```
document = docx.Document("test_files/docx/sample_docx.docx")
[e for e in document.element.body]
```
we can get the following data:
```
[<CT_P '<w:p>' at 0x156f771b0>,
<CT_... | [
{
"body": "**Is your feature request related to a problem? Please describe.**\r\nThe current version of the `DOCXToDocument` does not extract tables from `docx` documents.\r\n\r\n\r\n**Describe the solution you'd like**\r\nAbility to extract tables from documents while preserving their original structure.\r\n\r... | 906177329bcc54f6946af361fcd3d0e334e6ce5f | {
"head_commit": "2dd3777af49287f2b5f362c378f882ded6d8af4c",
"head_commit_message": "Add table_format as str init param",
"patch_to_review": "diff --git a/haystack/components/converters/docx.py b/haystack/components/converters/docx.py\nindex 8ffc3888a8..016fe18cc3 100644\n--- a/haystack/components/converters/docx... | [
{
"diff_hunk": "@@ -59,6 +63,30 @@ class DOCXMetadata:\n version: str\n \n \n+class TableFormat(Enum):",
"line": null,
"original_line": 66,
"original_start_line": null,
"path": "haystack/components/converters/docx.py",
"start_line": null,
"text": "@user1:\nLet's not use a generic nam... | 3e851925e73e70c2130342d1731ad7e0e3393bf6 | diff --git a/haystack/components/converters/docx.py b/haystack/components/converters/docx.py
index 8ffc3888a8..dc0a51f485 100644
--- a/haystack/components/converters/docx.py
+++ b/haystack/components/converters/docx.py
@@ -2,12 +2,15 @@
#
# SPDX-License-Identifier: Apache-2.0
+import csv
import io
from dataclasse... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "New Feature Additions"
} |
cython__cython-5919@e84a1bd | cython/cython | Python | 5,919 | Add `if` parameter to `parallel()` and `prange()` | Fixes #5393
> Note: documentation needs to be updated too
| 2023-12-22T07:34:16Z | [ENH] parallel/prange(..., if=N>100) and friends
### Is your feature request related to a problem? Please describe.
In my code, I would like to only create parallel/openmp regions for simple/loop constructs with a certain size.
For instance the overhead of calling a loop construct with 10 elements (with very little... | This sounds reasonable. It's probably medium difficulty to implement. I think we'd just call the argument `if_` - that sort of name is fairly common elsewhere in the Python world.
Sounds great!
Don't read that as a promise to do it though! Just that it sounds like a nice feature if someone did do it!
I actually managed... | [
{
"body": "### Is your feature request related to a problem? Please describe.\n\nIn my code, I would like to only create parallel/openmp regions for simple/loop constructs with a certain size. \r\nFor instance the overhead of calling a loop construct with 10 elements (with very little work on each iteration) c... | 80cc6516be04998b01545f9952f60affc139cb1d | {
"head_commit": "e84a1bda2b3eaedb1649647865cbea685741e00d",
"head_commit_message": "Add `if` parameter to `parallel()` and `prange()`",
"patch_to_review": "diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py\nindex fc4a31f180b..c625030ccd0 100644\n--- a/Cython/Compiler/Nodes.py\n+++ b/Cython/Compile... | [
{
"diff_hunk": "@@ -9090,6 +9090,7 @@ class ParallelStatNode(StatNode, ParallelNode):\n \n num_threads = None\n chunksize = None\n+ _if = None",
"line": null,
"original_line": 9093,
"original_start_line": null,
"path": "Cython/Compiler/Nodes.py",
"start_line": null,
"text": "@... | 18183024ecb3cc8d3505c9751fbd13a1b85406b9 | diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py
index 7b0a4e7d6c8..8afe4e30fbf 100644
--- a/Cython/Compiler/Nodes.py
+++ b/Cython/Compiler/Nodes.py
@@ -9083,7 +9083,7 @@ class ParallelStatNode(StatNode, ParallelNode):
construct (replaced by its compile time value)
... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "New Feature Additions"
} |
deepset-ai__haystack-8423@35bee20 | deepset-ai/haystack | Python | 8,423 | feat: allow `Generators` to run with a system prompt defined at run time | ### Related Issues
- fixes [#8394](https://github.com/deepset-ai/haystack/issues/8394)
### Proposed Changes:
- added an extra optional parameter to the run method, `system_prompt`, which overwrites the value of `system_prompt` if set during initialisation
- changed a few methods in OpenGenerator to static met... | 2024-09-30T13:34:35Z | feat: Make system_prompt in Generators a runtime parameter as well
It'd be nice to be able to change the system prompt at run time to allow for easier experimentation when working with pipelines defined in yaml files. Otherwise it requires changing the yaml file to test changes rather than being able to change the call... | Hi @sjrl - here's a draft PR: https://github.com/deepset-ai/haystack/pull/8423/files
Let me know if this is what you are after. We then need to add it to every possible generator, to make it coherent. | [
{
"body": "It'd be nice to be able to change the system prompt at run time to allow for easier experimentation when working with pipelines defined in yaml files. Otherwise it requires changing the yaml file to test changes rather than being able to change the call to the pipeline run method to insert a new syst... | 322f63de6db065101c7037488355c01a7123dea7 | {
"head_commit": "35bee2039315828665d35f91e83f2b747ea9fece",
"head_commit_message": "supporting the three use cases: no system prompt, using system prompt defined at init, using system prompt defined at run time",
"patch_to_review": "diff --git a/haystack/components/generators/openai.py b/haystack/components/gene... | [
{
"diff_hunk": "@@ -170,6 +170,7 @@ def from_dict(cls, data: Dict[str, Any]) -> \"OpenAIGenerator\":\n def run(\n self,\n prompt: str,\n+ run_time_system_prompt: Optional[str] = None,",
"line": null,
"original_line": 173,
"original_start_line": null,
"path": "haystack/... | b7a576303b3f2d7521169e798ff30618852b059f | diff --git a/haystack/components/generators/openai.py b/haystack/components/generators/openai.py
index 83f1a02d96..48180fc321 100644
--- a/haystack/components/generators/openai.py
+++ b/haystack/components/generators/openai.py
@@ -170,6 +170,7 @@ def from_dict(cls, data: Dict[str, Any]) -> "OpenAIGenerator":
def r... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "New Feature Additions"
} |
cython__cython-5899@b6a1cae | cython/cython | Python | 5,899 | [Docs] Reorganize and improve documenation of `include_dirs` and `include_path` | This PR:
* Fixes wrong documentation of `include_path` which does not control search path of C/C++ headers - fixes #1480
* Improves documentation of `Extention` parameters used in example to have it self contained and reader does not need to visit setuptools documentation for details.
* Adds *Compilation using setupto... | 2023-12-09T17:55:15Z | docs error: cythonize(include_path=x) does not set C include path
The documentation in [compilation.rst](../blob/master/docs/src/reference/compilation.rst#configuring-the-c-build) claims that
```
cythonize(extensions, include_path=[numpy.get_include()])
```
adds the numpy include path to the include file search path ... | Whatever you do, make sure not to break existing packages using `include_path` or `include_dirs` correctly :-)
I'd say it's not a doc bug but a Cython bug. `cythonize` produces an `Extension` object which has `include_dirs` as one of its attributes. `cythonize` should be setting this attribute.
```
>>> from Cython.Bui... | [
{
"body": "The documentation in [compilation.rst](../blob/master/docs/src/reference/compilation.rst#configuring-the-c-build) claims that\n\n```\ncythonize(extensions, include_path=[numpy.get_include()])\n```\n\nadds the numpy include path to the include file search path used by the compiler. This has been quote... | 2f93a5f92a80352e72f5fa9679fd282cb7a497ad | {
"head_commit": "b6a1cae703977837e264e87b686e0088d19e7778",
"head_commit_message": "Reorganize compilation documentation",
"patch_to_review": "diff --git a/docs/src/userguide/numpy_tutorial.rst b/docs/src/userguide/numpy_tutorial.rst\nindex d2828ebaba4..b45b1964a4d 100644\n--- a/docs/src/userguide/numpy_tutorial... | [
{
"diff_hunk": "@@ -143,6 +146,62 @@ in your Cython code.\n This creates :file:`yourmod.so` in the same directory, which is importable by\n Python by using a normal ``import yourmod`` statement.\n \n+\n+Compilation using setuptools\n+----------------------------\n+\n+Setuptools allows us to create setup.py file... | 7b7437264204c333fbcba9335dbd2adfd6570232 | diff --git a/docs/src/userguide/language_basics.rst b/docs/src/userguide/language_basics.rst
index c1db172e309..a4b990146e9 100644
--- a/docs/src/userguide/language_basics.rst
+++ b/docs/src/userguide/language_basics.rst
@@ -1510,6 +1510,7 @@ if the corresponding definition file also defines that type.
and classes... | {
"difficulty": "low",
"estimated_review_effort": 2,
"problem_domain": "Documentation Updates"
} |
deepset-ai__haystack-8363@e5d833c | deepset-ai/haystack | Python | 8,363 | ci: Slightly rework docs release process | Fixes #8331.
This changes some stuff about the documentation release process.
The `release_docs.py` used to create a new unstable version from the existing one and then promote the existing one to stable.
If we were releasing `2.9.x` we would create `2.10-unstable` on Readme based on `2.9-unstable` and change `2... | 2024-09-12T15:39:32Z | Update readme_sync workflow to generate a new "-unstable" version only with actual release
**Current situation:**
When we _branch out_ before the release, the docs automatically switch to the new version and create a new "unstable" version, meaning that they do this "pre-release".
So, before the release, I have to _ma... | [
{
"body": "**Current situation:** \nWhen we _branch out_ before the release, the docs automatically switch to the new version and create a new \"unstable\" version, meaning that they do this \"pre-release\".\nSo, before the release, I have to _manually_ go to the docs and switch them to previous version, then I... | 907ee04c584759dcadc686e3e04fa07f91b48c56 | {
"head_commit": "e5d833c7361b9458b678366553e46bf8eb69da34",
"head_commit_message": "Slightly rework docs release process",
"patch_to_review": "diff --git a/.github/utils/create_unstable_docs.py b/.github/utils/create_unstable_docs.py\nnew file mode 100644\nindex 0000000000..17ed97c289\n--- /dev/null\n+++ b/.gith... | [
{
"diff_hunk": "@@ -0,0 +1,55 @@\n+import os\n+import base64\n+import requests\n+\n+\n+\n+class ReadmeAuth(requests.auth.AuthBase):\n+ def __call__(self, r):\n+ r.headers[\"authorization\"] = f\"Basic {readme_token()}\"\n+ return r\n+\n+\n+def readme_token():\n+ api_key = os.getenv(\"RDME_AP... | 635fb4cbe887e86df0803ddccf94a217e057ea75 | diff --git a/.github/utils/create_unstable_docs.py b/.github/utils/create_unstable_docs.py
new file mode 100644
index 0000000000..a60d0328c9
--- /dev/null
+++ b/.github/utils/create_unstable_docs.py
@@ -0,0 +1,54 @@
+import re
+import sys
+import argparse
+
+from readme_api import get_versions, create_new_unstable
+
+
... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} | |
cupy__cupy-7814@ac999ee | cupy/cupy | Python | 7,814 | Fix cuTENSOR contraction descriptor cache | Close #7318. Close #7812.
The mode labels encapsulated by the `Mode` object should be cached, not just the pointer to it as the same memory could be garbage collected and reused, leading to erroneous cache hits.
The added tests would fail without the fix. | 2023-08-21T13:28:50Z | Wrong answer got from `contraction` function in `cutensor` lib
### Description
In some case, the `contraction` function in `cutensor` lib will give the wrong answer. This problem is very likely to show up when call several `contraction` function sequencely and with similar contraction order. See the code bellow for ... | I think this bug is related to a similar caching scheme in cuda called "Plan Cache" (https://docs.nvidia.com/cuda/cutensor/plan_cache.html) that is automatically enabled. The cupy caching scheme may conflict with the plan cache. I propose to disable all caching schemes in cupy.cutensor.
@jemiryguo so sorry for late re... | [
{
"body": "### Description\r\n\r\nIn some case, the `contraction` function in `cutensor` lib will give the wrong answer. This problem is very likely to show up when call several `contraction` function sequencely and with similar contraction order. See the code bellow for example. There are several ways to corre... | db0be4f6be5f849dcba0a9ca2cb5f840d8028923 | {
"head_commit": "ac999ee8eef510796ea6cfc0e6a85821766a0da0",
"head_commit_message": "add tests",
"patch_to_review": "diff --git a/cupyx/cutensor.pyx b/cupyx/cutensor.pyx\nindex a672a8eb914..e157ae3f286 100644\n--- a/cupyx/cutensor.pyx\n+++ b/cupyx/cutensor.pyx\n@@ -122,6 +122,14 @@ cdef class Mode:\n def __re... | [
{
"diff_hunk": "@@ -423,9 +431,9 @@ cdef inline ContractionDescriptor _create_contraction_descriptor(\n cdef ContractionDescriptor desc\n \n key = (handle.ptr, cutensor_compute_type,\n- desc_A.ptr, mode_A.data, alignment_req_A,\n- desc_B.ptr, mode_B.data, alignment_req_B,\n- ... | 8af1d6f3153943ade3995622e85672dcd34f9271 | diff --git a/cupyx/cutensor.pyx b/cupyx/cutensor.pyx
index a672a8eb914..3d7e98576d4 100644
--- a/cupyx/cutensor.pyx
+++ b/cupyx/cutensor.pyx
@@ -122,6 +122,11 @@ cdef class Mode:
def __repr__(self):
return 'mode(' + ', '.join([str(x) for x in self._array]) + ')'
+ def __eq__(self, other):
+ if... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
cython__cython-5844@dd8098c | cython/cython | Python | 5,844 | Infer the result type of builtin numeric binary operations | See https://github.com/cython/cython/issues/4237
Closes https://github.com/cython/cython/issues/5743 | 2023-11-19T12:26:52Z | Replace `coerce_to_integer()` with `coerce_to_index()`
### Describe your issue
We use `coerce_to_integer()` in several places where we intend to convert a (Python) value to a C integer index value. However, the method coerces to C `long` internally and thus risks an incomplete value range on Windows (where `long` is 3... | [
{
"body": "### Describe your issue\n\nWe use `coerce_to_integer()` in several places where we intend to convert a (Python) value to a C integer index value. However, the method coerces to C `long` internally and thus risks an incomplete value range on Windows (where `long` is 32 bits).\r\n\r\nIt feels wrong to ... | 5e77b987657e034378f914d42320d689ebafdb67 | {
"head_commit": "dd8098c8af38ebb3d45781c10c2d59072e828e03",
"head_commit_message": "Set up rules for inferring the result type of builtin numeric binary operations.\n\nSee https://github.com/cython/cython/issues/4237",
"patch_to_review": "diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py\n... | [
{
"diff_hunk": "@@ -5161,6 +5161,36 @@ def real_type(ntype):\n return widest_type\n \n \n+\n+def result_type_of_builtin_operation(builtin_type, type2):\n+ \"\"\"\n+ Try to find a suitable (C) result type for a binary operation with a known builtin type.\n+ \"\"\"\n+ if builtin_type.name == 'floa... | 58c16f051d4ba04eef74e1f893c7e82bc96e43b4 | diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py
index c462a03d33a..648015dc88b 100644
--- a/Cython/Compiler/ExprNodes.py
+++ b/Cython/Compiler/ExprNodes.py
@@ -1121,12 +1121,9 @@ def coerce_to_boolean(self, env):
error(self.pos, "Type '%s' not acceptable as a boolean" % type)
... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Code Refactoring / Architectural Improvement"
} | |
cython__cython-5785@13c4ad3 | cython/cython | Python | 5,785 | Optimize numerical operations with python integer variable | For now let's get optimisation of int variable on par with untype variable. Further optimisations can be done in separate PR.
Fixes #5783.
| 2023-10-27T20:52:30Z | [BUG] Operations with variable annotated with `int` avoids optimisations
### Describe the bug
When variable has type `int` in pure python mode, Cython is using generic `PyObject_RichCompare` instead of optimised `__Pyx_PyInt_EqObjC` which is used when no annotation is used.
### Code to reproduce the behaviour:
```py... | I suspect what's happened is that the check is probably based on `is py_object_type` and we assume anything typed with something else *isn't* an int.
We could probably do better though if we really wanted:
`__Pyx_PyInt_EqObjC` is written with the assumption that `a` is probably an `int` but doesn't have to be. So w... | [
{
"body": "### Describe the bug\n\nWhen variable has type `int` in pure python mode, Cython is using generic `PyObject_RichCompare` instead of optimised `__Pyx_PyInt_EqObjC` which is used when no annotation is used.\n\n### Code to reproduce the behaviour:\n\n```python\r\ndef bar(a: int):\r\n print(a == 5)\r\... | 526e1fc943c5768600c3aeb3fdee7051b8375318 | {
"head_commit": "13c4ad3e7d0adcb1d1cb27f78ca953fb9222f2de",
"head_commit_message": "Assert tree in tests",
"patch_to_review": "diff --git a/Cython/Compiler/Optimize.py b/Cython/Compiler/Optimize.py\nindex 42fab2e2cdb..5138e016a3c 100644\n--- a/Cython/Compiler/Optimize.py\n+++ b/Cython/Compiler/Optimize.py\n@@ -3... | [
{
"diff_hunk": "@@ -4207,12 +4221,12 @@ def optimise_numeric_binop(operator, node, ret_type, arg0, arg1):\n # Prefer constants on RHS as they allows better size control for some operators.\n num_nodes = (ExprNodes.IntNode, ExprNodes.FloatNode)\n if isinstance(arg1, num_nodes):\n- if arg0.type... | 95f6e403b769b6d831eefb7a86b20949b3af7c45 | diff --git a/Cython/Compiler/Optimize.py b/Cython/Compiler/Optimize.py
index 42fab2e2cdb..9cf4e80a603 100644
--- a/Cython/Compiler/Optimize.py
+++ b/Cython/Compiler/Optimize.py
@@ -3463,6 +3463,20 @@ def _handle_simple_method_object___truediv__(self, node, function, args, is_unbo
def _handle_simple_method_object__... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "Bug Fixes"
} |
cython__cython-5804@955886c | cython/cython | Python | 5,804 | Use vectorcall by default | f(a, b) goes to vectorcall (as before)
f(a, b, **kwds) now goes to "vectorcall_dict
f(a, b, c=c) now goes to vectorcall with kwnames
Will eventually fix https://github.com/cython/cython/issues/5784 | 2023-11-07T08:28:43Z | Add (and use) vectorcall utility-code functions
### Describe your issue
For the Limited API (and elsewhere) we're sometimes needing to fall back to standard Python calls (a recent example is `int.from_bytes`).
`PyObject_Vectorcall` and `PyObject_VectorcallMethod` and available in Limited API 3.12 upwards, and the r... | [
{
"body": "### Describe your issue\n\nFor the Limited API (and elsewhere) we're sometimes needing to fall back to standard Python calls (a recent example is `int.from_bytes`).\r\n\r\n`PyObject_Vectorcall` and `PyObject_VectorcallMethod` and available in Limited API 3.12 upwards, and the regular API for much lon... | 02ddde36567db52ecfb5004039221db8e2bec60c | {
"head_commit": "955886c31364e7d4084e410ca1c5b44e13f46f74",
"head_commit_message": "Add tests\n\nand tweak choices about when to optimize a little",
"patch_to_review": "diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py\nindex 9edac7d2fea..b040478f15b 100644\n--- a/Cython/Compiler/ExprNodes... | [
{
"diff_hunk": "@@ -6582,49 +6591,108 @@ def attribute_is_likely_method(attr):\n else:\n likely_method = 'unlikely'\n \n- code.putln(\"#if CYTHON_UNPACK_METHODS\")\n- code.putln(\"if (%s(PyMethod_Check(%s))) {\" % (likely_method, function))\n- code.putln(\"%s = PyMethod_... | 5df97d023f7a27d41ef1aa59912c2590c5d4d4e3 | diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py
index 9edac7d2fea..4d6621e2daa 100644
--- a/Cython/Compiler/ExprNodes.py
+++ b/Cython/Compiler/ExprNodes.py
@@ -5984,6 +5984,16 @@ def analyse_as_type_constructor(self, env):
self.type = type
return True
+ def functi... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "New Feature Additions"
} | |
cython__cython-5597@1eb81bc | cython/cython | Python | 5,597 | Use hex to store large integers | This avoids running into Python's limits about the maximum number of digits to use in string conversion.
Fixes #5596
I suspect this isn't *everywhere* that could generate long number strings but it's sufficient to solve the reported bug. | 2023-08-07T06:44:48Z | [BUG] Integer string conversion limit
### Describe the bug
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "setup.py", line 10, in <module>
ext_modules=cythonize("dp.pyx", compiler_directives=compiler_directives),
File "Cython/Build/Dependencies... | > should allow one to overide the python3 new security settings
That's arguably something that you should be doing (e.g. the `PYTHONINTMAXSTRDIGITS` environmental variable) and we shouldn't be taking the decision for you.
I suspect in a lot of cases we could just write a hex value instead though.
Hex values (in s... | [
{
"body": "### Describe the bug\n\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n File \"setup.py\", line 10, in <module>\r\n ext_modules=cythonize(\"dp.pyx\", compiler_directives=compiler_directives),\r\n File \"Cython/Build/Dependencies.p... | 6ad6ca0e9e7d030354b7fe7d7b56c3f6e6a4bc23 | {
"head_commit": "1eb81bcab224faeebccbad7402eddc651347429b",
"head_commit_message": "Fix code format",
"patch_to_review": "diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py\nindex 275a6233da5..4822791f451 100644\n--- a/Cython/Compiler/ExprNodes.py\n+++ b/Cython/Compiler/ExprNodes.py\n@@ -13... | [
{
"diff_hunk": "@@ -454,6 +455,16 @@ def str_to_number(value):\n return -value if is_neg else value\n \n \n+def strip_l_py2(value_str):",
"line": null,
"original_line": 458,
"original_start_line": null,
"path": "Cython/Utils.py",
"start_line": null,
"text": "@user1:\n`l` is easy to c... | cd927bb817186bab784e7bc543a02fa81818bddc | diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py
index 275a6233da5..091cd6a53f6 100644
--- a/Cython/Compiler/ExprNodes.py
+++ b/Cython/Compiler/ExprNodes.py
@@ -1365,6 +1365,16 @@ class IntNode(ConstNode):
longness = ""
is_c_literal = None # unknown
+ # hex_value and base_10_valu... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "Bug Fixes"
} |
cython__cython-5577@03b1369 | cython/cython | Python | 5,577 | Fix issues with parallel/exception checked functions | Essentially the problem is that a `nogil` function just promises that the function *can* be called without the GIL, not that it actually doesn't have the GIL.
If you call `prange`/`parallel` inside that function while still holding the GIL, if any thread has finished the GIL will be held (... I think it's probably m... | 2023-07-29T21:20:02Z | [BUG] OpenMP does not work anymore with function call on cython 3.0
### Describe the bug
After upgrading from Cython 0.29.36 to Cython 3.0.0 produced code just hang infinitly when OpenMP is used and sub-function are called.
Looking at produced code for bellow lines:
```python
for j in prange(J):
foo_vec(x[:,... | I finaly found that the `noexcept` is now required before `nogil` qualifier to tell cython that `cdef` function will not raise any exception.
It fix this issue.
@arthurlm This looks like a simpler duplicate of https://github.com/cython/cython/issues/5564. So thanks for the example - it'll hopefully be easier to inve... | [
{
"body": "### Describe the bug\n\nAfter upgrading from Cython 0.29.36 to Cython 3.0.0 produced code just hang infinitly when OpenMP is used and sub-function are called.\r\n\r\nLooking at produced code for bellow lines:\r\n```python\r\nfor j in prange(J):\r\n foo_vec(x[:, j], y[:, j])\r\n```\r\n\r\nUsing Cyt... | c64702f563a1bf5a8f45ba6b796e29382a609d62 | {
"head_commit": "03b1369d8d36aaef87d0a4d9f7520d13d3dfc29c",
"head_commit_message": "Add extra field in pxd",
"patch_to_review": "diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py\nindex 275a6233da5..02799816640 100644\n--- a/Cython/Compiler/ExprNodes.py\n+++ b/Cython/Compiler/ExprNodes.py\... | [
{
"diff_hunk": "@@ -3514,6 +3514,7 @@ def __call__(self, root):\n # True for 'cdef func() nogil:' functions, as the GIL may be held while\n # calling this function (thus contained 'nogil' blocks may be valid).\n self.nogil_declarator_only = False\n+ self.current_gilstat_node_knows... | e04ebc6177aa87276ab7d7b679c035cb792c6c0a | diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py
index 275a6233da5..02799816640 100644
--- a/Cython/Compiler/ExprNodes.py
+++ b/Cython/Compiler/ExprNodes.py
@@ -6291,6 +6291,12 @@ def analyse_c_function_call(self, env):
if needs_cpp_exception_conversion(func_type):
... | {
"difficulty": "high",
"estimated_review_effort": 4,
"problem_domain": "Bug Fixes"
} |
cython__cython-5537@60d6df3 | cython/cython | Python | 5,537 | Fix attribute lookup of standard library names | The attributes were accidently being converted to NameNode instead. The tests weren't picking this up because the names were available so were being looked up successfully.
Fixes #5536 | 2023-07-17T20:30:36Z | [BUG] NameError: name 'Dict' is not defined
### Describe the bug
When import `typing` and accessing `typing.Dict` a `NameError` is raised.
This does not occur with `Cython<3`.
### Code to reproduce the behaviour:
```cython
import typing
typing.Dict
```
### Expected behaviour
An exception is not raised.
### ... | Hmm. I'm fairly sure we test more complicated versions of that so I wonder what's going wrong with the simple version. Thanks for the report
The bug occurs for us in a "more complex" scenario, but I was able to reproduce with this simple example.
If it helps to have our actual source of the issue for context: https:... | [
{
"body": "### Describe the bug\n\nWhen import `typing` and accessing `typing.Dict` a `NameError` is raised.\r\n\r\nThis does not occur with `Cython<3`.\n\n### Code to reproduce the behaviour:\n\n```cython\r\nimport typing\r\ntyping.Dict\r\n```\n\n### Expected behaviour\n\nAn exception is not raised.\n\n### OS\... | c8fe79db1356e8bc235b2e4684f417cc52f3ed35 | {
"head_commit": "60d6df35a44622deb69b2e9e6ce81084e4c6544e",
"head_commit_message": "Fix attribute lookup of standard library names\n\nThe attributes were accidently being converted to NameNode\ninstead. The tests weren't picking this up because the names\nwere available so were being looked up successfully.\n\nFix... | [
{
"diff_hunk": "@@ -592,6 +594,7 @@ def get_known_standard_library_module_scope(module_name):\n var_entry.is_pyglobal = True\n var_entry.scope = mod\n entry.as_variable = var_entry\n+ entry.known_standard_library_import = \"%s.%s\" % (module_name, name)",
"line": null,
"or... | 511817174a8d4cf59be30575a5d2c6da638f1b60 | diff --git a/Cython/Compiler/Builtin.py b/Cython/Compiler/Builtin.py
index f7540a6084b..46dea9282be 100644
--- a/Cython/Compiler/Builtin.py
+++ b/Cython/Compiler/Builtin.py
@@ -572,6 +572,7 @@ def get_known_standard_library_module_scope(module_name):
var_entry.is_variable = True
var_entry.scop... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
cython__cython-5487@555b6a5 | cython/cython | Python | 5,487 | Dont override language_level from directives when set to None | Fixes #5484
| 2023-06-14T20:18:05Z | [BUG] -3 does not set language level in Cython 3
### Describe the bug
The -3 flag does not set language level to 3.
When compiling some code with the ``always_allow_keywords`` directive set to true with Cython 3, Cython doesn't set the language level to 3 even though ``-3`` is passed, and infers the language level ... | Thanks for the report. Can reproduce this. Just to make clear (since it wasn't 100% clear to me from the issue) it's the '-X ...' argument that seems to trigger it. A simple `cython -3 filename.pyx` looks to work fine.
Issue is caused by following lines:
https://github.com/cython/cython/blob/0605b260541394d7b33110d0f2... | [
{
"body": "### Describe the bug\n\nThe -3 flag does not set language level to 3.\r\n\r\nWhen compiling some code with the ``always_allow_keywords`` directive set to true with Cython 3, Cython doesn't set the language level to 3 even though ``-3`` is passed, and infers the language level as ``3str`` causing the ... | 11d83adca9cd6763805bd7a2550329979cbf0c78 | {
"head_commit": "555b6a5d4c33d3dff4101e02b2766e7d2dfc93e2",
"head_commit_message": "Fix wording",
"patch_to_review": "diff --git a/Cython/Compiler/Options.py b/Cython/Compiler/Options.py\nindex e7b33fbc6e9..11862b95660 100644\n--- a/Cython/Compiler/Options.py\n+++ b/Cython/Compiler/Options.py\n@@ -651,7 +651,7 @... | [
{
"diff_hunk": "@@ -651,7 +651,7 @@ def __init__(self, defaults=None, **kw):\n import warnings\n warnings.warn(\"C++ mode forced when in Pythran mode!\")\n options['cplus'] = True\n- if 'language_level' in directives and 'language_level' not in kw:\n+ if directi... | 1eae74d230e23653c7971f864194381de28eef84 | diff --git a/Cython/Compiler/Options.py b/Cython/Compiler/Options.py
index e7b33fbc6e9..8dd30e5070e 100644
--- a/Cython/Compiler/Options.py
+++ b/Cython/Compiler/Options.py
@@ -651,7 +651,7 @@ def __init__(self, defaults=None, **kw):
import warnings
warnings.warn("C++ mode forced when in Pythr... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
encode__django-rest-framework-8979@516ba52 | encode/django-rest-framework | Python | 8,979 | Fix validation for ListSerializer | ## Description
This PR fixes #8926. It makes the instance variable of child serializer point to the correct list object instead of the entire list when validating ListSerializer.
### Problem
As mentioned in #8926, when calling `is_valid` on a serializer that has been initialized with `many=True`, the `instanc... | 2023-05-10T20:31:02Z | Invalid `self.instance` when validating the serializer using `many=True`
Currently it is almost impossible to use the same serializer with and without `many=True` and the problem that sometimes serializer depending on the instance state or value during serialization and validation (usually it is PATCH method and `parti... | I understand what you're trying to do here but I'm not sure how the values in the `data` list and the `objs` that you pass as the `instance` would correspond to each other. Would you assume that they are matched via indexes? Would you want to introduce a new keyword argument (e.g `instances`) just to make it clearer?
... | [
{
"body": "Currently it is almost impossible to use the same serializer with and without `many=True` and the problem that sometimes serializer depending on the instance state or value during serialization and validation (usually it is PATCH method and `partial=True`\r\n\r\nThis is the simplest example to unders... | d252d22343b9c9688db77b59aa72dabd540bd252 | {
"head_commit": "516ba527dd181035049c9b7ecef9bd618da07376",
"head_commit_message": "fix imports sorting for list serializer tests",
"patch_to_review": "diff --git a/rest_framework/serializers.py b/rest_framework/serializers.py\nindex 01bebf5fca..9301484dc2 100644\n--- a/rest_framework/serializers.py\n+++ b/rest_... | [
{
"diff_hunk": "@@ -663,7 +668,10 @@ def to_internal_value(self, data):\n ret = []\n errors = []\n \n- for item in data:\n+ for idx, item in enumerate(data):\n+ if hasattr(self, 'instance') and self.instance and \\\n+ len(self.instance) > idx:",
"l... | d74744969546bcd4a57223abb3d5f7dd8badec50 | diff --git a/rest_framework/serializers.py b/rest_framework/serializers.py
index a3d68b03db..56fa918dc8 100644
--- a/rest_framework/serializers.py
+++ b/rest_framework/serializers.py
@@ -609,6 +609,12 @@ def __init__(self, *args, **kwargs):
self.min_length = kwargs.pop('min_length', None)
assert self.... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "Bug Fixes"
} |
cython__cython-5446@4b45774 | cython/cython | Python | 5,446 | Allow `dataclasses.dataclass` to be used directly on extension types | Also implements the same for `functools.total_ordering`.
Closes https://github.com/cython/cython/issues/5292 - as discussed in that issue, if the directives are taken from the `cython` module, `cclass` is automatically implied. | 2023-05-21T15:24:37Z | [ENH] use `@dataclasses.dataclass` to cdef dataclasses (instead of `@cython.dataclasses.dataclass`)
### Is your feature request related to a problem? Please describe.
One confusing feature of Cython dataclasses is that you have to cimport `cython.dataclasses.dataclass` and `cython.dataclasses.field` to use them, but a... | I agree, both for `@dataclasses.dataclass` and `@functools.total_ordering`, when used on a `cdef ` class (and `@cython.cclass`, obviously).
I additionally suggest that putting `@cython.dataclasses.dataclass` on a Python class should mean both `@cython.cclass` and `@dataclasses.dataclass`, without the need for an ad... | [
{
"body": "### Is your feature request related to a problem? Please describe.\n\nOne confusing feature of Cython dataclasses is that you have to cimport `cython.dataclasses.dataclass` and `cython.dataclasses.field` to use them, but all other dataclass-related imports (e.g. `dataclasses.ClassVar` and any runtime... | 8d974dcebc92a54747afd8f271ac734b829c019f | {
"head_commit": "4b457746c2302bfd1a6362c77b1c779d3ed45af6",
"head_commit_message": "Update documentation",
"patch_to_review": "diff --git a/Cython/Compiler/Builtin.py b/Cython/Compiler/Builtin.py\nindex 78b2638d5c7..4c7220125fd 100644\n--- a/Cython/Compiler/Builtin.py\n+++ b/Cython/Compiler/Builtin.py\n@@ -591,7... | [
{
"diff_hunk": "@@ -391,7 +391,7 @@ class DEFER_ANALYSIS_OF_ARGUMENTS:\n 'fast_gil': ('module',),\n 'iterable_coroutine': ('module', 'function'),\n 'trashcan' : ('cclass',),\n- 'total_ordering': ('cclass', ),\n+ 'total_ordering': ('cclass', 'class'),\n 'dataclasses.dataclass' : ('class', '... | d534e6ade75204e0c280fa0d615c266dd908d263 | diff --git a/Cython/Compiler/Builtin.py b/Cython/Compiler/Builtin.py
index 78b2638d5c7..4c7220125fd 100644
--- a/Cython/Compiler/Builtin.py
+++ b/Cython/Compiler/Builtin.py
@@ -591,7 +591,15 @@ def get_known_standard_library_module_scope(module_name):
var_entry.is_pyglobal = True
var_entry.scope = mod... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "Code Refactoring / Architectural Improvement"
} |
cython__cython-5368@c351a28 | cython/cython | Python | 5,368 | Handle additions to signatures in Py3.12 dataclasses | Fixes #5346.
I've written a potentially slightly inefficient helper function to inspect the signature of dataclasses.field and
dataclasses._DataclassParams and drop any arguments that are unsupported (i.e. ones that we're passing because they apply to later Python versions). | 2023-04-10T12:44:08Z | [BUG] "pure_cdef_class_dataclass" test fails in Py3.12
### Describe the bug
The `_DataclassParams` class apparently changed its constructor.
```
======================================================================
ERROR: runTest (__main__.CythonRunTestCase.runTest)
[2] compiling (c/cy2) and running pure_cdef_cla... | I think this is (indirectly) my fault - I suggested that they add a bunch of fields that were missing from `_DataclassParams`.
FWIW I have a branch where this is fixed. I hadn't made a PR for it because it was on-top of [another pending PR](https://github.com/cython/cython/pull/4989). But I'll see if I can quickly pick... | [
{
"body": "### Describe the bug\n\nThe `_DataclassParams` class apparently changed its constructor.\r\n```\r\n======================================================================\r\nERROR: runTest (__main__.CythonRunTestCase.runTest)\r\n[2] compiling (c/cy2) and running pure_cdef_class_dataclass\r\n----------... | d0bbecb7fba10f8a992972ea824b55a851646938 | {
"head_commit": "c351a28f5b70e7642645570ab11a4a15f2c2a6a1",
"head_commit_message": "Comments from review",
"patch_to_review": "diff --git a/Cython/Compiler/Dataclass.py b/Cython/Compiler/Dataclass.py\nindex 7d685917053..e775e918280 100644\n--- a/Cython/Compiler/Dataclass.py\n+++ b/Cython/Compiler/Dataclass.py\n@... | [
{
"diff_hunk": "@@ -76,3 +76,103 @@ static PyObject* __Pyx_Load_{{cname}}_Module(void); /* proto */\n static PyObject* __Pyx_Load_{{cname}}_Module(void) {\n return __Pyx_LoadInternalModule(\"{{cname}}\", {{py_code}});\n }\n+\n+//////////////////// DataclassesCallHelper.proto ////////////////////////\n+\n+st... | e534eb92c5f9add3dc9a8d88fd5408077f5ac12a | diff --git a/Cython/Compiler/Dataclass.py b/Cython/Compiler/Dataclass.py
index 7d685917053..e775e918280 100644
--- a/Cython/Compiler/Dataclass.py
+++ b/Cython/Compiler/Dataclass.py
@@ -34,7 +34,21 @@ def make_dataclasses_module_callnode(pos):
args=[],
)
-_INTERNAL_DEFAULTSHOLDER_NAME = EncodedString('__... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "Bug Fixes"
} |
cython__cython-5358@f4e8f47 | cython/cython | Python | 5,358 | Fix duplication of `IS_UNSIGNED_IMPL` | Closes #5356, Fixes #5302 | 2023-04-04T19:22:19Z | [BUG] Error at compilation with `overflowcheck(True)`.
### Describe the bug
I get an error at compilation when using `overflowcheck(True)` with 3.0.0b2.
Prior version worked well.
### Code to reproduce the behaviour:
```cython
%%cython --cplus
cimport cython
@cython.overflowcheck(True)
cdef size_t _mul_chec... | ~It seems to be unintational that cython includes util twice~ It happend so `Buffer.c` and `Overflow.c` were included at the same time
but the easy fix of moving `__PYX_IS_UNSIGNED_IMPL ` into cython module util will help | [
{
"body": "### Describe the bug\n\nI get an error at compilation when using `overflowcheck(True)` with 3.0.0b2.\r\nPrior version worked well.\n\n### Code to reproduce the behaviour:\n\n```cython\r\n%%cython --cplus\r\n\r\ncimport cython\r\n\r\n@cython.overflowcheck(True)\r\ncdef size_t _mul_checked(size_t a, si... | 4c9d7eb3a048e7089e8bda5387f63455226e3be8 | {
"head_commit": "f4e8f47815f770cc3152afc38f0e727630cbb1f5",
"head_commit_message": "Use char buffers so bytearray would be accepted",
"patch_to_review": "diff --git a/Cython/Utility/Buffer.c b/Cython/Utility/Buffer.c\nindex 7f4775e0248..be50d0f4807 100644\n--- a/Cython/Utility/Buffer.c\n+++ b/Cython/Utility/Buff... | [
{
"diff_hunk": "@@ -53,14 +53,7 @@ static void __Pyx_RaiseBufferFallbackError(void) {\n \n /////////////// BufferFormatStructs.proto ///////////////\n //@proto_block: utility_code_proto_before_types\n-\n-#ifdef __cplusplus\n-template<typename T>\n-struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < ... | fb40543f181feb7643b86984df582f70ca6b2fca | diff --git a/Cython/Utility/Buffer.c b/Cython/Utility/Buffer.c
index 7f4775e0248..8958b9e5008 100644
--- a/Cython/Utility/Buffer.c
+++ b/Cython/Utility/Buffer.c
@@ -54,14 +54,6 @@ static void __Pyx_RaiseBufferFallbackError(void) {
/////////////// BufferFormatStructs.proto ///////////////
//@proto_block: utility_code_... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
cython__cython-5710@9666e11 | cython/cython | Python | 5,710 | Avoid using strings for exception_value of func_type | The main advantage is that we don't end up hugely sensitive to the exact string representation of a particular number.
Fixes #5709 | 2023-09-17T13:21:57Z | [BUG] values used for exception_value are really inconsistent
### Describe the bug
This is something I'm running into while trying to sort out implicit exception_value for fused types. But it's a general problem not related to fused functions.
Essentially for floating point types, Cython uses a number of differen... | > I think the mistake is using strings to represent `exception_value`
Not entirely a mistake. You can have an exception value that is an enum name, for example. So, if we start using numeric values, we'll still have to deal with strings, but then in combination with different numeric data types. | [
{
"body": "### Describe the bug\r\n\r\nThis is something I'm running into while trying to sort out implicit exception_value for fused types. But it's a general problem not related to fused functions.\r\n\r\nEssentially for floating point types, Cython uses a number of different representations of the exception ... | a8b26e9a4b96f84258da43564c42eb0d2d1912a0 | {
"head_commit": "9666e110d2255f1f4e90870b75f71931eccd09f2",
"head_commit_message": "Avoid boolnode",
"patch_to_review": "diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py\nindex 28daa01faca..dd075e016fb 100644\n--- a/Cython/Compiler/ExprNodes.py\n+++ b/Cython/Compiler/ExprNodes.py\n@@ -610... | [
{
"diff_hunk": "@@ -740,8 +740,8 @@ def analyse(self, return_type, env, nonempty=0, directive_locals=None, visibilit\n # for now.\n if not env.is_c_class_scope and not isinstance(self.base, CPtrDeclaratorNode):\n from .ExprNodes import ConstNode\... | e49988c55e7a750cff9a6400354a1d60c1837bdd | diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py
index 51733611c11..61422e5a816 100644
--- a/Cython/Compiler/ExprNodes.py
+++ b/Cython/Compiler/ExprNodes.py
@@ -592,6 +592,21 @@ def compile_time_value_error(self, e):
error(self.pos, "Error in compile-time expression: %s: %s" % (
... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "Bug Fixes"
} |
cython__cython-5332@284cac5 | cython/cython | Python | 5,332 | Fix ufunc GIL handling | It looks like Numpy releases the GIL for us (unless it's PyObject arguments), so we should assume that we don't have the GIL, and write code to regain it if needed, rather than assuming we need to release the GIL.
Fixes #5328 | 2023-03-21T19:20:19Z | Fatal Python error: PyEval_SaveThread when creating ufunc with nogil [BUG]
### Describe the bug
I'm generating ufuncs for my fortran library by the new version 3.0.0b1 of cython, using the @cython.ufunc function decorator.
I declare the function as nogil. and call it in python script. It works fine when the input ar... | So it looks like I misunderstood ufuncs and the GIL. I'd assumed that it was up to the user to release the GIL in a ufunc (on the basis that they'd documented macros to do so https://numpy.org/doc/stable/reference/c-api/ufunc.html#macros). But it looks like Numpy releases it automatically. It only becomes an issue for ... | [
{
"body": "### Describe the bug\n\nI'm generating ufuncs for my fortran library by the new version 3.0.0b1 of cython, using the @cython.ufunc function decorator.\r\nI declare the function as nogil. and call it in python script. It works fine when the input array length is less than 500. When the input array len... | 10aa1bf6821398c8d0e881e5348c2930df6d0b04 | {
"head_commit": "284cac53c94117293f5c25e8c90c1ad4b41cce94",
"head_commit_message": "Fix ufunc GIL handling\n\nIt looks like Numpy releases the GIL for us (unless it's PyObject\narguments), so we should assume that we don't have the GIL, and\nwrite code to regain it if needed, rather than assuming we need\nto relea... | [
{
"diff_hunk": "@@ -29,6 +40,8 @@ def test_tripple_it():\n array([[168., 171.],\n [198., 201.],\n [228., 231.]])\n+ >>> dont_print(tripple_it(large_int_arr_1d))\n+ >>> dont_print(tripple_it(large_int_arr_2d))",
"line": null,
"original_line": 44,
"original_start_line":... | dabd2f0c976a508723fd32cc075def589562b3d6 | diff --git a/Cython/Compiler/UFuncs.py b/Cython/Compiler/UFuncs.py
index ce6de62fe23..5e641d785bb 100644
--- a/Cython/Compiler/UFuncs.py
+++ b/Cython/Compiler/UFuncs.py
@@ -138,6 +138,9 @@ def generate_cy_utility_code(self):
ufunc_cname = self.global_scope.next_id(self.node.entry.name + "_ufunc_def")
+ ... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
dask__dask-11931@f8c809e | dask/dask | Python | 11,931 | Fix ``to_dask_array`` for single partition | Closes https://github.com/dask/dask/issues/11928 | 2025-05-05T16:19:19Z | `FrameBase.to_dask_array` raises error when `lengths=True`
**Describe the issue**:
The `FrameBase.to_dask_array` raises `TypeError: 'int' object is not iterable` when called with `lengths=True`
**Minimal Complete Verifiable Example**:
```python
import numpy as np
import dask.dataframe as dd
data = dd.from_array(np... | [
{
"body": "**Describe the issue**:\n\nThe `FrameBase.to_dask_array` raises `TypeError: 'int' object is not iterable` when called with `lengths=True`\n\n\n**Minimal Complete Verifiable Example**:\n\n```python\nimport numpy as np\nimport dask.dataframe as dd\n\ndata = dd.from_array(np.random.normal(size=(10_000, ... | 4914f2f58df72dbaf1036ee2c69b6372bc60f3d1 | {
"head_commit": "f8c809e4457f593cda5553804ebbca0d1d078189",
"head_commit_message": "Fix to_dask_array for single partition",
"patch_to_review": "diff --git a/dask/dataframe/dask_expr/_collection.py b/dask/dataframe/dask_expr/_collection.py\nindex 91fea784018..a851e81ca79 100644\n--- a/dask/dataframe/dask_expr/_c... | [
{
"diff_hunk": "@@ -1404,7 +1404,11 @@ def to_dask_array(\n A Dask Array\n \"\"\"\n if lengths is True:\n- lengths = tuple(self.map_partitions(len, enforce_metadata=False).compute())\n+ lens = self.map_partitions(len).compute()",
"line": null,
"original_line... | 3650e44320335972659d550879c3f3b7448844d5 | diff --git a/dask/dataframe/dask_expr/_collection.py b/dask/dataframe/dask_expr/_collection.py
index 91fea784018..0e16f3ed9e5 100644
--- a/dask/dataframe/dask_expr/_collection.py
+++ b/dask/dataframe/dask_expr/_collection.py
@@ -1404,7 +1404,7 @@ def to_dask_array(
A Dask Array
"""
if lengths... | {
"difficulty": "medium",
"estimated_review_effort": 2,
"problem_domain": "Bug Fixes"
} | |
cython__cython-5302@3c8f1f8 | cython/cython | Python | 5,302 | allow IS_UNSIGNED to handle const types | this adds support for constant types in the `IS_UNSIGNED` macro to fix #5301 without reducing const correctness.
This uses the same implementation used for the C++11 type_trait `std::is_unsigned`: https://en.cppreference.com/w/cpp/types/is_unsigned | 2023-03-08T09:13:20Z | [BUG] `IS_UNSIGNED()` macro is applied to `const` types in test suite
### Describe the bug
Example (there are several such modules):
```
Compiler output for module memslice:
memslice.cpp:1348:37: warning: type qualifiers ignored on cast result type [-Wignored-qualifiers]
#define IS_UNSIGNED(type) (((type) -1) > 0... | [
{
"body": "### Describe the bug\n\nExample (there are several such modules):\r\n```\r\nCompiler output for module memslice:\r\nmemslice.cpp:1348:37: warning: type qualifiers ignored on cast result type [-Wignored-qualifiers]\r\n #define IS_UNSIGNED(type) (((type) -1) > 0)\r\n ... | f089ff9d568f5925866703bebdb5e87060498c6c | {
"head_commit": "3c8f1f834959f73f629f1e3d4c6e1b7db981d661",
"head_commit_message": "use template for unsigned check",
"patch_to_review": "diff --git a/Cython/Utility/Buffer.c b/Cython/Utility/Buffer.c\nindex 3ea9a1b90fe..6b89f20e83a 100644\n--- a/Cython/Utility/Buffer.c\n+++ b/Cython/Utility/Buffer.c\n@@ -54,7 +... | [
{
"diff_hunk": "@@ -31,7 +31,13 @@ static int __Pyx_check_twos_complement(void) {\n }\n }\n \n+#ifdef __cplusplus\n+template<typename T>\n+struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);};\n+#define __PYX_IS_UNSIGNED(type) IS_UNSIGNED_IMPL<type>::value",
"line": null,
"origina... | c9045014afb65ee502797744f17697362398f1da | diff --git a/Cython/Compiler/Buffer.py b/Cython/Compiler/Buffer.py
index e33a95e298a..e86e1e9c24d 100644
--- a/Cython/Compiler/Buffer.py
+++ b/Cython/Compiler/Buffer.py
@@ -699,10 +699,10 @@ def get_type_information_cname(code, dtype, maxdepth=None):
flags = "0"
is_unsigned = "0"
if dtype is ... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} | |
deepset-ai__haystack-8042@e82f9ac | deepset-ai/haystack | Python | 8,042 | feat: Implement apply_filter_policy and FilterPolicy.MERGE for the new filters | ### Why:
Implements proper merging of new filters.
- fixes: https://github.com/deepset-ai/haystack/issues/7995
### What:
- Implemented new utility functions to determine filter types (`is_legacy`, `is_comparison_filter`, `is_logical_filter`).
- Extended the `apply_filter: policy` function to support merging of... | 2024-07-18T09:14:08Z | `apply_filter_policy` and `FilterPolicy.MERGE` don't work properly for the new filter syntax
**Is your feature request related to a problem? Please describe.**
The current `apply_filter_policy` function in our retrieval system only supports legacy dictionary-based filters. This limitation becomes problematic for new f... | @julian-risch @mrm1001 this one is needed for the final 2.3.0 release cc @sjrl
I have the most context to fix this one and @sjrl will review
So I think there are three basic scenarios that we might like to cover:
1. Combining two comparison filters together where a logical operator needs to be provided by the user.... | [
{
"body": "**Is your feature request related to a problem? Please describe.**\r\nThe current `apply_filter_policy` function in our retrieval system only supports legacy dictionary-based filters. This limitation becomes problematic for new filters syntax. For example, we can't merge filters like: \r\n`{\"field\"... | 031b0bfbd836f128736220589917a62c43c9c512 | {
"head_commit": "e82f9ac43465816fafffcee9d43f64e3eb281414",
"head_commit_message": "Add reno note",
"patch_to_review": "diff --git a/haystack/document_stores/types/filter_policy.py b/haystack/document_stores/types/filter_policy.py\nindex a2be576d20..66f849adaa 100644\n--- a/haystack/document_stores/types/filter_... | [
{
"diff_hunk": "@@ -36,10 +36,41 @@ def from_str(filter_policy: str) -> \"FilterPolicy\":\n return policy\n \n \n+def is_legacy(filter_item: Dict[str, Any]) -> bool:\n+ \"\"\"\n+ Check if the given filter is a legacy filter.\n+\n+ :param filter_item: The filter to check.\n+ :returns: True if... | a1cc6f942270682104fa850980a9204fefacea98 | diff --git a/haystack/document_stores/types/__init__.py b/haystack/document_stores/types/__init__.py
index df2032f79c..ed6becf8b4 100644
--- a/haystack/document_stores/types/__init__.py
+++ b/haystack/document_stores/types/__init__.py
@@ -2,8 +2,8 @@
#
# SPDX-License-Identifier: Apache-2.0
-from .filter_policy impo... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "New Feature Additions"
} |
cython__cython-5272@d65e2cf | cython/cython | Python | 5,272 | Fix annotation typing of Optional[tuple] | Allow it to use a Py-tuple instead of a ctuple
Fixes https://github.com/cython/cython/issues/5263 | 2023-02-27T18:58:45Z | [BUG] Compile error when typing.Optional and tuple[float] used in function annotation
### Describe the bug
Cython compile throwing unexpected error. No error when annotated variable though. Used to work correctly in last alpha (3.0.0a11).
Command:
cythonize -3 test.py
Traceback:
test.py:10:27: typing.Optio... | Thanks. A lot of this subscripted type annotation code is pretty new so we won't have caught all the corner cases.
I suspect what's happening is
```
tuple[float]
```
Is evaluating to a "c tuple" type. And it's falling to apply `Optional` to that. We should make sure that it doesn't do the "c tuple" change in pla... | [
{
"body": "### Describe the bug\n\nCython compile throwing unexpected error. No error when annotated variable though. Used to work correctly in last alpha (3.0.0a11).\r\n\r\nCommand:\r\ncythonize -3 test.py \r\n\r\nTraceback:\r\ntest.py:10:27: typing.Optional[...] cannot be applied to non-Python type (double... | 31e9bb73988fd6c77bcc419d702df748feb24b4a | {
"head_commit": "d65e2cf366d4a31a351bfa7364074aa926325cab",
"head_commit_message": "Fix annotation typing of Optional[tuple]\n\nAllow it to use a Py-tuple instead of a ctuple",
"patch_to_review": "diff --git a/Cython/Compiler/PyrexTypes.py b/Cython/Compiler/PyrexTypes.py\nindex b431255e4f5..3e7b6149961 100644\n-... | [
{
"diff_hunk": "@@ -4464,6 +4464,9 @@ def __init__(self, cname, components):\n self.exception_check = True\n self._convert_to_py_code = None\n self._convert_from_py_code = None\n+ # equivalent_type must be set now because it isn't available at import time\n+ from . import B... | 876c3a526e9a423afcb7c9ac834773f693c74ef3 | diff --git a/Cython/Compiler/PyrexTypes.py b/Cython/Compiler/PyrexTypes.py
index b431255e4f5..f55423feba9 100644
--- a/Cython/Compiler/PyrexTypes.py
+++ b/Cython/Compiler/PyrexTypes.py
@@ -4464,6 +4464,9 @@ def __init__(self, cname, components):
self.exception_check = True
self._convert_to_py_code = N... | {
"difficulty": "medium",
"estimated_review_effort": 2,
"problem_domain": "Bug Fixes"
} |
cupy__cupy-7122@0d4784c | cupy/cupy | Python | 7,122 | Fix compile error from `inf`/`nan` in cupy.fuse | Close #7118. | 2022-10-17T04:07:10Z | [Discussion needed] Add ways to write `inf` and `nan` as literals in fused and user-defined kernels.
### Description
Currently, literals such as `inf` and `nan` cannot be used inside a `ElementwiseKernel` or a fused kernel.
To test whether that's the case, we can write down the following code.
```python
@cp.fuse... | I guess it's only a matter of float-to-string conversion here.
https://github.com/cupy/cupy/blob/3ac3f9d6bffac33bccd236fc4306a2f83b90c4f5/cupy/_core/fusion.pyx#L121-L122
Maybe @asi1024 can better follow up on this :)
@berryboy2012 Thank you for your reporting. Fixed in #7122! | [
{
"body": "### Description\r\n\r\nCurrently, literals such as `inf` and `nan` cannot be used inside a `ElementwiseKernel` or a fused kernel. \r\nTo test whether that's the case, we can write down the following code.\r\n```python\r\n@cp.fuse\r\ndef test_inf_nan(arr):\r\n arr[:] = cp.inf\r\n arr[:] = cp.nan... | 9d3bf3f208e40eff8bea14a7b0b2b3bf14fb488e | {
"head_commit": "0d4784c98f93f84db0f2d99c9734958c4f1a8009",
"head_commit_message": "Fix compile error from inf/nan in cupy.fuse",
"patch_to_review": "diff --git a/cupy/_core/fusion.pyx b/cupy/_core/fusion.pyx\nindex 472235de138..89f6bb803c8 100644\n--- a/cupy/_core/fusion.pyx\n+++ b/cupy/_core/fusion.pyx\n@@ -11... | [
{
"diff_hunk": "@@ -119,7 +119,15 @@ class _FusionVarCUDA(object):\n elif isinstance(val, complex):\n init = '({}, {})'.format(c.real, c.imag)\n elif isinstance(val, (int, float)):\n- init = '= {}'.format(c)\n+ if numpy.isnan(val):\n+ init = '= __... | 737f8f3a9d86613d73b562b9ddf205615bc10ffa | diff --git a/cupy/_core/_scalar.pxd b/cupy/_core/_scalar.pxd
index 83c4887ef3e..8cd84c5794b 100644
--- a/cupy/_core/_scalar.pxd
+++ b/cupy/_core/_scalar.pxd
@@ -34,3 +34,4 @@ cpdef str get_typename(dtype)
cdef set scalar_type_set
cdef CScalar scalar_to_c_scalar(object x)
cdef object scalar_to_numpy_scalar(object x)
... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "New Feature Additions"
} |
deepset-ai__haystack-7994@c9bf955 | deepset-ai/haystack | Python | 7,994 | feat: Configure max_retries and timeout for AzureOpenAIDocumentEmbedder | max_retries: if not set is read from the OPENAI_MAX_RETRIES env variable or set to 5.
timeout: if not set is read from the OPENAI_TIMEOUT env variable or set to 30.
### Related Issues
- fixes #7945
### Proposed Changes:
<!--- In case of a bug: Describe what caused the issue and how you solved it -->
... | 2024-07-08T13:19:32Z | Add `max_retries` and `timeout` params to all `AzureOpenAI` classes
**Is your feature request related to a problem? Please describe.**
Currently all `OpenAI` related classes (e.g. `OpenAIDocumentEmbedder`, `OpenAIChatGenerator`) can be initialised by setting `max_retries` and `timeout` params.
The corresponding `... | Thanks @EdoardoAbatiTR!
I'm also opening this for contributions. In case anyone is interested, let's discuss it here.
Hey,
I am new here. Can I assign this to myself?
@nvzard feel free to work on this. Take a look at the [guidelines for contributors](https://github.com/deepset-ai/haystack/blob/main/CONTRIBUTING... | [
{
"body": "**Is your feature request related to a problem? Please describe.**\r\n\r\nCurrently all `OpenAI` related classes (e.g. `OpenAIDocumentEmbedder`, `OpenAIChatGenerator`) can be initialised by setting `max_retries` and `timeout` params.\r\n\r\nThe corresponding `AzureOpenAI` don't always have the same p... | d7a7d9c1fb07c9e351a740e33e9347c67e0ccf08 | {
"head_commit": "c9bf955cd9c6b93f4000973a25f96949b57c8861",
"head_commit_message": "feat: Configure max_retries & timeout for AzureOpenAIDocumentEmbedder\n\nmax_retries: if not set is read from the OPENAI_MAX_RETRIES\nenv variable or set to 5.\n\ntimeout: if not set is read from the OPENAI_TIMEOUT\nenv variable or... | [
{
"diff_hunk": "@@ -84,6 +86,10 @@ def __init__(\n List of meta fields that will be embedded along with the Document text.\n :param embedding_separator:\n Separator used to concatenate the meta fields to the Document text.\n+ :param timeout: The timeout to be passed to the... | e4177322794a45399de38ee385d388034ed722ff | diff --git a/haystack/components/embedders/azure_document_embedder.py b/haystack/components/embedders/azure_document_embedder.py
index 5488087832..50720d075c 100644
--- a/haystack/components/embedders/azure_document_embedder.py
+++ b/haystack/components/embedders/azure_document_embedder.py
@@ -33,7 +33,7 @@ class Azure... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "New Feature Additions"
} |
deepset-ai__haystack-7988@509a50e | deepset-ai/haystack | Python | 7,988 | feat: Configure `max_retries` and timeout for `AzureOpenAIChatGenerator` | max_retries: if not set is read from the OPENAI_MAX_RETRIES env variable or set to 5.
timeout: if not set is read from the OPENAI_TIMEOUT env variable or set to 30.
### Related Issues
- fixes #7945
### Proposed Changes:
AzureOpenAIChatGenerator can be initiated using max_retries.
timeout can also be se... | 2024-07-07T14:31:20Z | Add `max_retries` and `timeout` params to all `AzureOpenAI` classes
**Is your feature request related to a problem? Please describe.**
Currently all `OpenAI` related classes (e.g. `OpenAIDocumentEmbedder`, `OpenAIChatGenerator`) can be initialised by setting `max_retries` and `timeout` params.
The corresponding `... | Thanks @EdoardoAbatiTR!
I'm also opening this for contributions. In case anyone is interested, let's discuss it here.
Hey,
I am new here. Can I assign this to myself?
@nvzard feel free to work on this. Take a look at the [guidelines for contributors](https://github.com/deepset-ai/haystack/blob/main/CONTRIBUTING... | [
{
"body": "**Is your feature request related to a problem? Please describe.**\r\n\r\nCurrently all `OpenAI` related classes (e.g. `OpenAIDocumentEmbedder`, `OpenAIChatGenerator`) can be initialised by setting `max_retries` and `timeout` params.\r\n\r\nThe corresponding `AzureOpenAI` don't always have the same p... | d7a7d9c1fb07c9e351a740e33e9347c67e0ccf08 | {
"head_commit": "509a50e084ffd8af9ecfe4b7ef8a77b2adedb44f",
"head_commit_message": "feat: Configure max_retries & timeout for AzureOpenAIChatGenerator\n\nmax_retries: if not set is read from the OPENAI_MAX_RETRIES\nenv variable or set to 5.\n\ntimeout: if not set is read from the OPENAI_TIMEOUT\nenv variable or se... | [
{
"diff_hunk": "@@ -95,6 +96,10 @@ def __init__(\n [production best practices](https://platform.openai.com/docs/guides/production-best-practices/setting-up-your-organization).\n :param streaming_callback: A callback function that is called when a new token is received from the stream.\n ... | bb3598901b7e5f9be8d332f5f4077f95a2b4b456 | diff --git a/haystack/components/generators/chat/azure.py b/haystack/components/generators/chat/azure.py
index 06da6095ae..9ef4311ec4 100644
--- a/haystack/components/generators/chat/azure.py
+++ b/haystack/components/generators/chat/azure.py
@@ -81,6 +81,7 @@ def __init__(
organization: Optional[str] = None,
... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "New Feature Additions"
} |
cython__cython-5219@052338d | cython/cython | Python | 5,219 | Fix bound class methods when unpacking builtin method calls | Enhance #5075 - use c api insted of evaluating python code
From #5075
> The general optimization for unpacking builtin method calls was breaking bound classmethods (with crashes on Py2 and wrong answers on Py3).
>
> This PR adds code to handle it. The code is unlikely to be very fast, but my judgement is that th... | 2023-01-19T11:31:35Z | [BUG] When using the dictionary fromkeys method in a class, the converted C source code crashes on execution
### Describe the bug
When using the dictionary fromkeys method in a class, the converted C source code crashes on execution
### Code to reproduce the behaviour:
```cython
# example code
class LsaLsdb(... | use dict.fromkeys() or {}.from, not use test_dict.fromkeys can avoid this problem
This appears to be Python 2 only.
The crash is at
https://github.com/cython/cython/blob/169876872f3cb6198971a1db07e5b8a9d12b3dac/Cython/Utility/ObjectHandling.c#L2008
(`d_method` is NULL).
```
(gdb) print(*method)
$4 = {ob_refc... | [
{
"body": "### Describe the bug\r\n\r\nWhen using the dictionary fromkeys method in a class, the converted C source code crashes on execution\r\n\r\n### Code to reproduce the behaviour:\r\n\r\n```cython\r\n# example code\r\nclass LsaLsdb(object):\r\n def __init__(self):\r\n pass\r\n\r\n def test(se... | 891d4604bcfbed45d1de66d1a4ac988c2b311e11 | {
"head_commit": "052338db9dd9c8a57a2c492f0275b7520fc4e330",
"head_commit_message": "ObjectHandling.c: fix comment alignment\n\n[skip ci]",
"patch_to_review": "diff --git a/Cython/Utility/ObjectHandling.c b/Cython/Utility/ObjectHandling.c\nindex f0b5c13720e..f82545b9de4 100644\n--- a/Cython/Utility/ObjectHandling... | [
{
"diff_hunk": "@@ -1992,6 +1992,25 @@ typedef struct {\n /////////////// UnpackUnboundCMethod ///////////////\n //@requires: PyObjectGetAttrStr\n \n+#define CONST_REINTERPRET_CAST(pointer_type, pointer) ((pointer_type)(void *)(pointer))",
"line": null,
"original_line": 1995,
"original_start_line": ... | d2c29bb427554d375c1680d3007f3d3849bd1b39 | diff --git a/Cython/Utility/ModuleSetupCode.c b/Cython/Utility/ModuleSetupCode.c
index 529acdcc3a1..b0797e94caf 100644
--- a/Cython/Utility/ModuleSetupCode.c
+++ b/Cython/Utility/ModuleSetupCode.c
@@ -541,6 +541,14 @@
#endif
#endif
+// reinterpret
+
+// TODO: refactor existing code to use those macros
+#define __... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "Bug Fixes"
} |
dask__dask-11441@3afe01a | dask/dask | Python | 11,441 | Implement fuse option for delayed objects | - [ ] Closes #11436
- [ ] Tests added / passed
- [ ] Passes `pre-commit run --all-files`
| 2024-10-17T17:06:33Z | Make it easier to enable linear fusion for delayed objects
Delayed can be used to express embarrassingly parallel chains of operations. Certain configurations benefit from processing one chain completely before starting a new one (high memory usage for example). This is currently not possible by default because other t... | [
{
"body": "Delayed can be used to express embarrassingly parallel chains of operations. Certain configurations benefit from processing one chain completely before starting a new one (high memory usage for example). This is currently not possible by default because other tasks will almost certainly run before fo... | 8eac2fa9931a206f3b80e06681e9768423c588f8 | {
"head_commit": "3afe01ae95286bcd81fbdd1fbfaca652c6152339",
"head_commit_message": "Fixup",
"patch_to_review": "diff --git a/dask/dask-schema.yaml b/dask/dask-schema.yaml\nindex 4be821187d6..267bbeccf07 100644\n--- a/dask/dask-schema.yaml\n+++ b/dask/dask-schema.yaml\n@@ -244,6 +244,13 @@ properties:\n ... | [
{
"diff_hunk": "@@ -855,3 +856,27 @@ def add(x, y):\n assert add.__name__ == \"add\"\n assert add.__doc__ == \"This is a docstring\"\n assert add.__wrapped__(1, 2) == 3\n+\n+\n+def test_delayed_fusion():\n+ @delayed\n+ def test(i):\n+ return i + 1\n+\n+ @delayed\n+ def test2(i):\n... | 1f06c85051bd0d59b4579283fdc72cf5242daf48 | diff --git a/dask/dask-schema.yaml b/dask/dask-schema.yaml
index 4be821187d6..267bbeccf07 100644
--- a/dask/dask-schema.yaml
+++ b/dask/dask-schema.yaml
@@ -244,6 +244,13 @@ properties:
False, then the top-most key will be used. For advanced usage, a function
to create the new name is also... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "New Feature Additions"
} | |
encode__django-rest-framework-6514@9c1fffa | encode/django-rest-framework | Python | 6,514 | Possibility to remove trailing zeros on DecimalFields representation | ## Description
It would be good to have a way of remove trailing zeros in output. For example when working with a lot of decimal precision you now get very long strings when representing them as string in outputs.
``` python
# Current
Decimal('0.001000000') >> "0.001000000"
# Changed
Decimal('0.001000000') >>... | 2019-03-19T16:23:41Z | DecimalField: str value without trailing zeros
I guess, `coerce_to_string=True` in DecimalField should safely remove trailing zeros and `coerce_to_string=False` should leave value unchanged. If it's true - why my values are with trailing zeros?
In old version of DRF values were without trailing zeros as I remember
``... | Just ran into this. I am using it to store SI multipliers for values series and having a series in kilo{something} it is not needed to output "1000.000000000000" in my JSON and its annoying to have to remember the amount of decimal places for simple tests.
This on the DecimalField seems to do it:
``` python
de... | [
{
"body": "I guess, `coerce_to_string=True` in DecimalField should safely remove trailing zeros and `coerce_to_string=False` should leave value unchanged. If it's true - why my values are with trailing zeros?\r\nIn old version of DRF values were without trailing zeros as I remember\r\n```\r\n| vaue | 24.4716351... | 78cdae69997c9fd95211ec15fb4e21f4cd45e30a | {
"head_commit": "9c1fffa8c39eeb646b73dd5cdf7635d5726fd34b",
"head_commit_message": "Fixed linting error in test_fields",
"patch_to_review": "diff --git a/docs/api-guide/fields.md b/docs/api-guide/fields.md\nindex ede4f15ad5..6ee3c7308d 100644\n--- a/docs/api-guide/fields.md\n+++ b/docs/api-guide/fields.md\n@@ -2... | [
{
"diff_hunk": "@@ -1125,6 +1126,11 @@ def to_representation(self, value):\n \n quantized = self.quantize(value)\n \n+ # TODO: Should maybe name the value to something not bound to\n+ # quantized. Ex: out_value",
"line": null,
"original_line": 1130,
"original_start_line": nul... | 92bcdd021a51d047836c6fdfdc4b981930717131 | diff --git a/docs/api-guide/fields.md b/docs/api-guide/fields.md
index 0a96d0e0c7..4b4ea83cc1 100644
--- a/docs/api-guide/fields.md
+++ b/docs/api-guide/fields.md
@@ -295,6 +295,7 @@ Corresponds to `django.db.models.fields.DecimalField`.
* `min_value` Validate that the number provided is no less than this value.
* `l... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
deepset-ai__haystack-7957@0c09e76 | deepset-ai/haystack | Python | 7,957 | feat: add custom jinja filter handling to ConditionalRouter | ### Related Issues
- fixes #7940
### Proposed Changes:
Added a `custom_filters: Optional[Dict[str, Callable]]` field to the `ConditionalRouter` constructor to allow users to pass in and use custom Jinja2 filters when creating route conditions. Also added the same field to `from_dict` to allow users to provid... | 2024-06-28T21:48:59Z | Add custom filter support to ConditionalRouter component
*Is your feature request related to a problem? Please describe.**
Currently, the `ConditionalRouter` component doesn't support custom filters in the 'condition' and 'output' fields of a route. This limitation restricts users from applying complex logic or data t... | Hi @vblagoje and team Haystack. I just implemented a custom component inheriting from `ConditionalRouter` that does this in a recent project. I'll submit a PR.
PR is up: https://github.com/deepset-ai/haystack/pull/7957 | [
{
"body": "*Is your feature request related to a problem? Please describe.**\r\nCurrently, the `ConditionalRouter` component doesn't support custom filters in the 'condition' and 'output' fields of a route. This limitation restricts users from applying complex logic or data transformations within these fields, ... | 03d9057e6421b8527ebd35abd2d38bcb7c178981 | {
"head_commit": "0c09e766e99ef4800d874cdfb2cb333f1eb1c383",
"head_commit_message": "Merge branch 'main' into issue-7940",
"patch_to_review": "diff --git a/haystack/components/routers/conditional_router.py b/haystack/components/routers/conditional_router.py\nindex 70325f4d51..3d675adaed 100644\n--- a/haystack/com... | [
{
"diff_hunk": "@@ -146,15 +157,22 @@ def to_dict(self) -> Dict[str, Any]:\n # output_type needs to be serialized to a string\n route[\"output_type\"] = serialize_type(route[\"output_type\"])\n \n- return default_to_dict(self, routes=self.routes)\n+ # set all filter callabl... | 436176d17fa02ca54ec0b8a3978d29a9e75e0a1e | diff --git a/haystack/components/routers/conditional_router.py b/haystack/components/routers/conditional_router.py
index 70325f4d51..be72c7cc5d 100644
--- a/haystack/components/routers/conditional_router.py
+++ b/haystack/components/routers/conditional_router.py
@@ -2,13 +2,13 @@
#
# SPDX-License-Identifier: Apache-2... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "New Feature Additions"
} |
cython__cython-5168@c49c683 | cython/cython | Python | 5,168 | Support 2 and 3 arg __[ri]pow__ | This change accepts both two and three argument versions for `__pow__`, `__rpow__` and `__ipow__`.
For the two arg versions it raises an exception if three arguments are passed (although accepts a third argument of 'None' since this is what Python does by default).
For the three arg versions it allows a default a... | 2022-12-10T11:58:05Z | [BUG] Required number of arguments for __pow__ prevents compiled and interpreted pure python code compatability
### Describe the bug
Cython mandates three argument for the special method __pow__ . My class makes no use of the third argument, but when compiling the code cython forces me to define one without a default ... | I think this would likely be tricky but not impossible (so we probably should do it, but I wouldn't expect it to be soon).
The special methods of cclasses map pretty directly onto the C API slots, and in this case the C API slot only defines the 3 argument version.
In terms of implementation there's two things we... | [
{
"body": "### Describe the bug\n\nCython mandates three argument for the special method __pow__ . My class makes no use of the third argument, but when compiling the code cython forces me to define one without a default value\r\n\r\nThat mean that code using the exponteation operator must have two different im... | 39ee651a45e45e31805aa94d5c119f0283637f94 | {
"head_commit": "c49c6830911345856ec74aa107a8dedd7a5d7d94",
"head_commit_message": "Fix other bugs",
"patch_to_review": "diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py\nindex 0a730856297..24349b1f10a 100644\n--- a/Cython/Compiler/ModuleNode.py\n+++ b/Cython/Compiler/ModuleNode.py\n@@ ... | [
{
"diff_hunk": "@@ -4521,6 +4532,32 @@ def generate_argument_type_tests(self, code):\n arg.type.is_buffer or\n arg.type.is_memoryviewslice):\n self.generate_arg_none_check(arg, code)\n+ if self.target.entr... | 9ffe8e3d875529a28938dcb03fa00c2c85fd8ed5 | diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py
index 0a730856297..24349b1f10a 100644
--- a/Cython/Compiler/ModuleNode.py
+++ b/Cython/Compiler/ModuleNode.py
@@ -2252,7 +2252,7 @@ def generate_binop_function(self, scope, slot, code, pos):
if slot.left_slot.signature in (TypeSlots.bin... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "Bug Fixes"
} |
cupy__cupy-6976@a1bd49c | cupy/cupy | Python | 6,976 | Make sparse argmin/max return a scalar array containing the index | Fixes #3640
The aforementioned issue only happened when `argmax/min` was called without an `axis` defined. Now `argmin/max` returns a scalar array with the index. | 2022-08-05T16:25:14Z | Sparse argmin/argmax return scalar values on CPU
CuPy returns zero-dimensional ndarrays for reduction functions where NumPy/SciPy return scalar values to keep off synchronizing between GPU and CPU. However, CuPy's sparse matrix argmin/argmax currently return scalar values as SciPy's counterparts, causing device to host... | If I'm understanding correctly, the preferred behavior is for CuPy to return a (1, self.shape[0]) in this case? I'm happy to put together a pull request.
No, CuPy should return a zero-dimensional array `cupy.array(value)`, completing the computation on the GPU side as described [here](https://docs.cupy.dev/en/stable/re... | [
{
"body": "CuPy returns zero-dimensional ndarrays for reduction functions where NumPy/SciPy return scalar values to keep off synchronizing between GPU and CPU. However, CuPy's sparse matrix argmin/argmax currently return scalar values as SciPy's counterparts, causing device to host sync.\r\n\r\n```Python\r\n>>>... | 704f87e927998f31534ab76b5d831f967114a84c | {
"head_commit": "a1bd49ca80fdf8b71b373a59925dca52617744a5",
"head_commit_message": "Remove element-by-element comparison",
"patch_to_review": "diff --git a/cupyx/scipy/sparse/_data.py b/cupyx/scipy/sparse/_data.py\nindex a6047dce706..df8149c4340 100644\n--- a/cupyx/scipy/sparse/_data.py\n+++ b/cupyx/scipy/sparse... | [
{
"diff_hunk": "@@ -121,15 +121,18 @@ def power(self, n, dtype=None):\n \n \n def _find_missing_index(ind, n):\n- for k, a in enumerate(ind):\n- if k != a:\n- return k\n+ positions = cupy.arange(ind.size)\n+ diff = ind != positions\n+ non_zero = cupy.argwhere(diff).ravel()",
"l... | 0dbd04088e22929856621fb63fe4c411cae65b06 | diff --git a/cupyx/scipy/sparse/_data.py b/cupyx/scipy/sparse/_data.py
index a6047dce706..1615aea2db1 100644
--- a/cupyx/scipy/sparse/_data.py
+++ b/cupyx/scipy/sparse/_data.py
@@ -1,4 +1,5 @@
import cupy
+import numpy as np
from cupy._core import internal
from cupy import _util
from cupyx.scipy.sparse import _base... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
cython__cython-5142@3fbacbf | cython/cython | Python | 5,142 | Relax `nogil_check()` of `SliceIndexNode` to support array initialisation | Fixes #3160
Fixes #1662
| 2022-11-21T23:13:19Z | Cannot copy C arrays in nogil functions
This code:
```
cdef void foo() nogil:
cdef double[16] x
cdef double[16] y
y[:] = x[:]
y = x
```
throws the compile time error "Slicing Python object not allowed without gil" for both assignments. However, the generated code in both cases is a simple me... | Also if I write the code like so, it appears I've run into issue ( https://github.com/cython/cython/issues/1662 ).
```cython
cdef void func() nogil:
cdef int[4] a
a[:] = [0, 1, 2, 3]
```
Same issue I encounter right now.
Looks like the GIL check in `SliceIndexNode` is too broad and does not detect the "... | [
{
"body": "This code:\r\n\r\n```\r\ncdef void foo() nogil:\r\n cdef double[16] x\r\n cdef double[16] y\r\n y[:] = x[:]\r\n y = x\r\n```\r\n\r\nthrows the compile time error \"Slicing Python object not allowed without gil\" for both assignments. However, the generated code in both cases is a simple m... | 5ae18baae5535756db8036ea91bda7bb4811d17f | {
"head_commit": "3fbacbf66f21563249443a3aac5c27e665acfef4",
"head_commit_message": "Update tests/run/nogil.pyx\n\nCo-authored-by: da-woods <dw-git@d-woods.co.uk>",
"patch_to_review": "diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py\nindex 88185153541..df95b8615f7 100644\n--- a/Cython/Com... | [
{
"diff_hunk": "@@ -104,3 +104,76 @@ def test_unraisable():\n finally:\n sys.stderr = old_stderr\n return stderr.getvalue().strip()\n+\n+\n+cdef int initialize_array() nogil:\n+ cdef int[4] a = [1, 2, 3, 4]\n+ return a[0] + a[1] + a[2] + a[3]\n+\n+cdef int copy_array() nogil:\n+ cdef in... | ddc3aa6a55fc60cece7b16e4463d742eeb1c2a5c | diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py
index 88185153541..df95b8615f7 100644
--- a/Cython/Compiler/ExprNodes.py
+++ b/Cython/Compiler/ExprNodes.py
@@ -5230,8 +5230,10 @@ class SliceIndexNode(ExprNode):
# start ExprNode or None
# stop ExprNode or None
# slice ... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
deepset-ai__haystack-7947@a67b4ad | deepset-ai/haystack | Python | 7,947 | feat: LLM-based evaluators return meta info from OpenAI | ### Related Issues
- fixes [#7905](https://github.com/deepset-ai/haystack/issues/7905)
### Proposed Changes:
pass the `meta` entry from openai api to the result for all the LLM-based evaluators, containing the following fields:
- model
- prompt tokens
- answer tokens
- total tokens
### How did you test ... | 2024-06-28T08:02:25Z | LLM-based Evaluators should return `meta` information provided by OpenAIGenerator
**Is your feature request related to a problem? Please describe.**
To calculate the cost of the evaluation, we need a token count. Most generator components in Haystack provide that information in the `meta` field.
**Describe the sol... | [
{
"body": "**Is your feature request related to a problem? Please describe.**\r\nTo calculate the cost of the evaluation, we need a token count. Most generator components in Haystack provide that information in the `meta` field.\r\n\r\n**Describe the solution you'd like**\r\nLLM-based evaluators should return ... | a86bf963a00e70a75ade00da09f28efd309d6639 | {
"head_commit": "a67b4ad7a055557da7504bdd0d6004e2d46c3a68",
"head_commit_message": "fixing live tests",
"patch_to_review": "diff --git a/haystack/components/evaluators/llm_evaluator.py b/haystack/components/evaluators/llm_evaluator.py\nindex 671ca57a58..6da3ccde2e 100644\n--- a/haystack/components/evaluators/llm... | [
{
"diff_hunk": "@@ -208,11 +211,14 @@ def run(self, **inputs) -> Dict[str, Any]:\n results.append(None)\n errors += 1\n \n+ if self.api == \"openai\" and \"meta\" in result:\n+ metadata = result[\"meta\"]\n+\n if errors > 0:\n msg = f... | ab51160d43b767b8c2188fd8aa012ae1c7cab23a | diff --git a/haystack/components/evaluators/llm_evaluator.py b/haystack/components/evaluators/llm_evaluator.py
index 671ca57a58..22885f87e4 100644
--- a/haystack/components/evaluators/llm_evaluator.py
+++ b/haystack/components/evaluators/llm_evaluator.py
@@ -171,10 +171,12 @@ def run(self, **inputs) -> Dict[str, Any]:
... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "New Feature Additions"
} | |
deepset-ai__haystack-7933@f4c9d69 | deepset-ai/haystack | Python | 7,933 | feat : adding `split_id` and `split_overlap` to `DocumentSplitter` | ### Related Issues
- fixes [#7389](https://github.com/deepset-ai/haystack/issues/7389)
### Proposed Changes:
When a `split_overlap` is set each produced chunk Document will have information:
- about the `split_id` allowing an ordering over the document chunks
- each document chunk will have in the `meta` the... | 2024-06-26T08:47:37Z | Adding splitting information in the metadata of DocumentSplitter output
**Is your feature request related to a problem? Please describe.**
When splitting a document in Haystack v1, the function _create_docs_from_splits() within the class PreProcessor() is able to save relevant metadata information such as _split_id an... | @tradicio are you using this information in your application?
Please explain your use case to understand how we can support it, possibly reintroducing this information.
Hi @anakin87, thanks for your message!
You're correct, I am using the _split_id and _split_overlap in my application in order to keep the informat... | [
{
"body": "**Is your feature request related to a problem? Please describe.**\r\nWhen splitting a document in Haystack v1, the function _create_docs_from_splits() within the class PreProcessor() is able to save relevant metadata information such as _split_id and _split_overlap. So far, the class DocumentSplitte... | 8b9eddcd948e972c844e03000c2802e85e462c2a | {
"head_commit": "f4c9d69b13cb76405ceac066474b6352e6876e07",
"head_commit_message": "making mypy happy",
"patch_to_review": "diff --git a/haystack/components/preprocessors/document_splitter.py b/haystack/components/preprocessors/document_splitter.py\nindex f5e048db6e..ed4339cbd1 100644\n--- a/haystack/components/... | [
{
"diff_hunk": "@@ -132,36 +132,80 @@ def _concatenate_units(\n \n text_splits: List[str] = []\n splits_pages = []\n+ splits_start_idxs = []\n+ split_at_len = len(self.split_at)\n+ cur_start_idx = 0\n cur_page = 1\n segments = windowed(elements, n=split_lengt... | 39b6efda020be95da9f2762b2f2a09375e494973 | diff --git a/haystack/components/preprocessors/document_splitter.py b/haystack/components/preprocessors/document_splitter.py
index f5e048db6e..200fa8aa92 100644
--- a/haystack/components/preprocessors/document_splitter.py
+++ b/haystack/components/preprocessors/document_splitter.py
@@ -90,38 +90,38 @@ def run(self, doc... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "New Feature Additions"
} |
cupy__cupy-6920@561c717 | cupy/cupy | Python | 6,920 | Fix `cupy.clip` to match numpy | Fixes #6901
Fixed the 'only `a_max` or `a_min` is given' issue by removing the default value of `None` for `a_min` and `a_max`.
Fixed the '`a_max` < `a_min`' issue by tweaking the cythonic implementation for the function.
Added test cases for the same. | 2022-07-27T20:45:16Z | `cupy.clip` behave differently from NumPy
### Description
The behavior is different from NumPy when
* only `a_max` or `a_min` is given
* `a_max` < `a_min`
### To Reproduce
CuPy:
```py
>>> import cupy as cp
>>> cp.clip(cp.arange(8), a_min=3, a_max=6)
array([3, 3, 3, 3, 4, 5, 6, 6])
>>> cp.clip(cp.arange(8), ... | Will take this up. | [
{
"body": "### Description\n\nThe behavior is different from NumPy when\r\n\r\n* only `a_max` or `a_min` is given\r\n* `a_max` < `a_min`\n\n### To Reproduce\n\nCuPy:\r\n```py\r\n>>> import cupy as cp\r\n>>> cp.clip(cp.arange(8), a_min=3, a_max=6)\r\narray([3, 3, 3, 3, 4, 5, 6, 6])\r\n>>> cp.clip(cp.arange(8), a... | b62686a1fa0727bc17b27cf142311d0658b90d53 | {
"head_commit": "561c717143de15d40f62f3fdf3520e7ae5d81b63",
"head_commit_message": "Coding style fix",
"patch_to_review": "diff --git a/cupy/_core/_routines_math.pyx b/cupy/_core/_routines_math.pyx\nindex 5203f104167..ef8f5c288f7 100644\n--- a/cupy/_core/_routines_math.pyx\n+++ b/cupy/_core/_routines_math.pyx\n@... | [
{
"diff_hunk": "@@ -132,6 +132,19 @@ def test_external_clip2(self, xp, dtype):\n a = testing.shaped_arange((2, 3, 4), xp, dtype)\n return xp.clip(a, 3, 13)\n \n+ @testing.for_all_dtypes(no_bool=True, no_complex=True)\n+ @testing.numpy_cupy_array_equal()\n+ def test_external_clip3(self, ... | 559000775737772abe7d6672c038910b18c49734 | diff --git a/cupy/_core/_routines_math.pyx b/cupy/_core/_routines_math.pyx
index 5203f104167..ef8f5c288f7 100644
--- a/cupy/_core/_routines_math.pyx
+++ b/cupy/_core/_routines_math.pyx
@@ -1114,7 +1114,7 @@ _clip = create_ufunc(
'cupy_clip',
('???->?', 'bbb->b', 'BBB->B', 'hhh->h', 'HHH->H', 'iii->i', 'III->I... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
dask__dask-11311@60f2c1a | dask/dask | Python | 11,311 | Implement automatic rechunking for shuffle | - [ ] Closes #11282
- [ ] Tests added / passed
- [ ] Passes `pre-commit run --all-files`
This makes the shuffle automatically split the other dimensions by a dynamic factor so that the maximum chunksize stays the same after the shuffle. The implementation ensures that we only split chunks along the other dimension... | 2024-08-14T11:02:48Z | Automatically rechunk in array-shuffle if groups are too large
shuffling an array can create big chunks along the shuffled dimension. Keeping the other chunk sizes constant will potentially blow up chunk sizes along the way.
The proper solution here is to rechunk on the other dimensions to be able to ensure that chu... | [
{
"body": "shuffling an array can create big chunks along the shuffled dimension. Keeping the other chunk sizes constant will potentially blow up chunk sizes along the way.\r\n\r\nThe proper solution here is to rechunk on the other dimensions to be able to ensure that chunk sizes stay reasonable.\r\n\r\nWe shou... | 67b2852d5f48d46527e3ac9c78122b483aef4057 | {
"head_commit": "60f2c1a8e2cc743103b8c4e70c8ccbbda3a1f7a5",
"head_commit_message": "Impleent automatic rechunking for shuffle",
"patch_to_review": "diff --git a/dask/array/_shuffle.py b/dask/array/_shuffle.py\nindex 6e3dd2e4ab2..6e0dd7e7b39 100644\n--- a/dask/array/_shuffle.py\n+++ b/dask/array/_shuffle.py\n@@ -... | [
{
"diff_hunk": "@@ -79,7 +87,44 @@ def shuffle(x, indexer: list[list[int]], axis):\n return Array(graph, out_name, chunks, meta=x)\n \n \n-def _shuffle(chunks, indexer, axis, in_name, out_name, token):\n+def _resize_other_dimensions(x: Array, longest_group, axis, chunks):\n+ assert chunks == \"auto\", \"... | f12ebf2445fa2ce03482d3ddae76fe3dc520e84a | diff --git a/dask/array/_shuffle.py b/dask/array/_shuffle.py
index 6e3dd2e4ab2..fa1c6ccd659 100644
--- a/dask/array/_shuffle.py
+++ b/dask/array/_shuffle.py
@@ -1,7 +1,9 @@
from __future__ import annotations
import copy
+import math
from itertools import count, product
+from typing import Literal
import numpy a... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "New Feature Additions"
} | |
cython__cython-5025@4761813 | cython/cython | Python | 5,025 | [Ticket 2940] fix mangling for .pxd cdef public functions | Fixes #2940
This PR fixes a typo that caused `cdef public` functions from .pxd files to be erroneously mangled.
The unmangled name is chosen when the definition from the .py file is processed, but on the condition that the cname determined while processing the declaration from the .pxd file was the mangled one (... | 2022-09-12T21:00:13Z | Compiling a .py file with an augmenting .pxd leads to a mangled function name for cdef public function.
I would like to use the .py, with augmenting .pxd method for my Cython project so I can debug and use an IDE while I develop. For some reason this method leads to mangled exported function names. The definition of th... | Thanks for the report. Could be that the `private` marker is simply not copied when adapting the Python function signature from the `.pxd` file in `AlignFunctionDefinitions` syntax tree transformation (`ParseTreeTransforms.py`). Probably easy to add there. PR welcome.
[Here](https://github.com/cython/cython/blob/master... | [
{
"body": "I would like to use the .py, with augmenting .pxd method for my Cython project so I can debug and use an IDE while I develop. For some reason this method leads to mangled exported function names. The definition of the function in the .pxd is ```cdef public int count_cwrap(int limit)``` and the .h fil... | 9fcf55fa86488bba666e918ba6550e976557411f | {
"head_commit": "47618138e280b0fa8a901a01a2356d5a9b3a4e32",
"head_commit_message": "Add to the list of skipped test because of a PyPy2 issue",
"patch_to_review": "diff --git a/Cython/Compiler/Symtab.py b/Cython/Compiler/Symtab.py\nindex 92afd877954..4d834d89682 100644\n--- a/Cython/Compiler/Symtab.py\n+++ b/Cyth... | [
{
"diff_hunk": "@@ -16,8 +16,9 @@ run.partial_circular_import\n # https://foss.heptapod.net/pypy/pypy/issues/3185\n run.language_level\n run.pure_pxd\n+run.pxd_mangling_names",
"line": null,
"original_line": 19,
"original_start_line": null,
"path": "tests/pypy2_bugs.txt",
"start_line": null,... | fd35dcdc714273d3973b02c5ec5787c14beb2d0d | diff --git a/Cython/Compiler/Symtab.py b/Cython/Compiler/Symtab.py
index 92afd877954..4d834d89682 100644
--- a/Cython/Compiler/Symtab.py
+++ b/Cython/Compiler/Symtab.py
@@ -1617,7 +1617,7 @@ def declare_cfunction(self, name, type, pos,
entry = self.lookup_here(name)
if entry and entry.defined_in_pxd:
... | {
"difficulty": "low",
"estimated_review_effort": 2,
"problem_domain": "Bug Fixes"
} |
deepset-ai__haystack-7841@39f1d14 | deepset-ai/haystack | Python | 7,841 | bug: fix MRR and MAP calculations | ### Related Issues
- fixes #7758
### Proposed Changes:
Fixed errors of MRREvaluator:
* Corrected the logic for calculation of MRR
* Added a flag to break the loop when condition is fulfilled
* Optimized the loops
Fixed errors of MAPEvaluator:
* Corrected the logic for calculation of MAP
* Optimized th... | 2024-06-11T14:06:32Z | MAP and MRR wrong for multiple gold documents
**Describe the bug**
Both the MAP and the MRR show wrong values. It seems we calculate the score for single gold documents and then override it after each instead of calculating it for the whole batch of gold documents.
**Expected behavior**
correct values
**To Rep... | Hi @ju-gu I'm trying to understand the example above. You are providing 10 "retrievals" but have only 5 gold truth docs? In other words, you have:
| Actual retrieved | True doc |
| --------------- | --------------- |
| one | one |
| two | two |
| three | three |
| four | four |
| five | seven |... | [
{
"body": "**Describe the bug**\r\nBoth the MAP and the MRR show wrong values. It seems we calculate the score for single gold documents and then override it after each instead of calculating it for the whole batch of gold documents. \r\n\r\n**Expected behavior**\r\ncorrect values\r\n\r\n**To Reproduce**\r\n```... | 58dd972d1aee35b0133172967b6ab20b7428ab60 | {
"head_commit": "39f1d1425ece8c423377368bc9a47007f467b626",
"head_commit_message": "removed unnecessary flag",
"patch_to_review": "diff --git a/haystack/components/evaluators/document_map.py b/haystack/components/evaluators/document_map.py\nindex f18a0e675b..df3a6a7776 100644\n--- a/haystack/components/evaluator... | [
{
"diff_hunk": "@@ -67,17 +67,19 @@ def run(\n \n for ground_truth, retrieved in zip(ground_truth_documents, retrieved_documents):\n score = 0.0\n+ ground_truth_content = []\n+\n for ground_document in ground_truth:\n if ground_document.content is None:... | 9a6bb93adedf07365701b0410cb1a769a1b370f2 | diff --git a/haystack/components/evaluators/document_map.py b/haystack/components/evaluators/document_map.py
index f18a0e675b..212edb86c1 100644
--- a/haystack/components/evaluators/document_map.py
+++ b/haystack/components/evaluators/document_map.py
@@ -43,6 +43,7 @@ class DocumentMAPEvaluator:
```
"""
+ ... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
deepset-ai__haystack-7849@5b021a1 | deepset-ai/haystack | Python | 7,849 | fix: ChatPromptBuilder Fails to JSON Serialize | ### Related Issues
- fixes #7844
### Proposed Changes:
<!--- In case of a bug: Describe what caused the issue and how you solved it -->
<!--- In case of a feature: Describe what did you add and how it works -->
The bug was caused by the 'ChatMessage' class not being serialized correctly, which led to a fa... | 2024-06-12T21:27:39Z | `ChatPromptBuilder` Fails to JSON Serialize due to `ChatMessage` class
**Describe the bug**
The new ChatPromptBuilder fails to serialize because of the ChatMessage dataclass. This component takes in a list of ChatMessages in the init method under the template
**Error message**
TypeError: Object of type ChatMessage... | Thanks for reporting this.
**Reproducible example**
```python
from haystack.components.builders.chat_prompt_builder import ChatPromptBuilder
from haystack.dataclasses import ChatMessage
from haystack import Pipeline
messages = [ChatMessage.from_system("Message")]
chat_prompt_builder = ChatPromptBuilder(templ... | [
{
"body": "**Describe the bug**\r\nThe new ChatPromptBuilder fails to serialize because of the ChatMessage dataclass. This component takes in a list of ChatMessages in the init method under the template\r\n\r\n**Error message**\r\nTypeError: Object of type ChatMessage is not JSON serializable\r\n\r\n**Expected ... | 3db56d9066db6cab8e19cf6e718b64e38c1f0b8b | {
"head_commit": "5b021a1c02b693ed464801eafe8e4fecfb619c8a",
"head_commit_message": "remove flattening parameter in to_dict",
"patch_to_review": "diff --git a/haystack/components/builders/chat_prompt_builder.py b/haystack/components/builders/chat_prompt_builder.py\nindex b49509d9c9..2f36686114 100644\n--- a/hayst... | [
{
"diff_hunk": "@@ -99,3 +99,51 @@ def from_function(cls, content: str, name: str) -> \"ChatMessage\":\n :returns: A new ChatMessage instance.\n \"\"\"\n return cls(content, ChatRole.FUNCTION, name)\n+\n+ def to_dict(self) -> Dict[str, Any]:\n+ \"\"\"\n+ Converts ChatMes... | af5304eaf20f497ed629a7973ac5c8846ab0dca8 | diff --git a/haystack/components/builders/chat_prompt_builder.py b/haystack/components/builders/chat_prompt_builder.py
index 44c857b40c..a1c47a5081 100644
--- a/haystack/components/builders/chat_prompt_builder.py
+++ b/haystack/components/builders/chat_prompt_builder.py
@@ -6,7 +6,7 @@
from jinja2 import Template, m... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
cython__cython-4952@c98deeb | cython/cython | Python | 4,952 | Added epilog to cythonize listing supported environment variables | I suppose we can close #1711 by accepting this PR.
| 2022-08-04T20:11:35Z | Make the cythonize command line more useful
A couple of more common build options, such as `--numpy`, `--include_path`, `--libraries`, `--cflags`, `--ldflags` should be added to `cythonize` command line so that it can be used easily for the majority of building tasks.
Setting up a `setup.py` script for every `pyx` ... | I extracted the cython magic into a separate script at https://github.com/netheril96/utilities/blob/master/mycython.py.
Just noting here something I noticed, cythonize CLI interface actually honors environment variables such as CC, CXX, LDSHARED, CFLAGS, CPPFLAGS, LDFLAGS... I assume this isn't documented under cythoni... | [
{
"body": "A couple of more common build options, such as `--numpy`, `--include_path`, `--libraries`, `--cflags`, `--ldflags` should be added to `cythonize` command line so that it can be used easily for the majority of building tasks. \r\n\r\nSetting up a `setup.py` script for every `pyx` file I need to write ... | 8ac874f10265f13ddcc34490e0b160f6a4e66e33 | {
"head_commit": "c98deeb9b76ae02386bc9522f68c3bef2dd992a8",
"head_commit_message": "Remove whitespace from empty line.\n\nCo-authored-by: da-woods <dw-git@d-woods.co.uk>",
"patch_to_review": "diff --git a/Cython/Build/Cythonize.py b/Cython/Build/Cythonize.py\nindex 1f79589f875..554e3888a5f 100644\n--- a/Cython/B... | [
{
"diff_hunk": "@@ -121,10 +121,17 @@ def run_distutils(args):\n \n \n def create_args_parser():\n- from argparse import ArgumentParser\n+ from argparse import ArgumentParser, RawDescriptionHelpFormatter\n from ..Compiler.CmdLine import ParseDirectivesAction, ParseOptionsAction, ParseCompileTimeEnvAct... | fd7054ed82cd0120e41dee420bd65479e48aadac | diff --git a/Cython/Build/Cythonize.py b/Cython/Build/Cythonize.py
index 1f79589f875..ab18a12bc71 100644
--- a/Cython/Build/Cythonize.py
+++ b/Cython/Build/Cythonize.py
@@ -121,10 +121,18 @@ def run_distutils(args):
def create_args_parser():
- from argparse import ArgumentParser
+ from argparse import Argume... | {
"difficulty": "low",
"estimated_review_effort": 2,
"problem_domain": "New Feature Additions"
} |
cython__cython-4954@4964de7 | cython/cython | Python | 4,954 | Treat annotations in functions in dataclasses normally | Fixes #4953.
Before this change the annotations were being treated as
"dataclass-related" annotations, and thus being made "public". | 2022-08-05T17:04:57Z | [BUG] Can't provide type for local variable in method of Dataclass
```cython
@cython.dataclasses.dataclass
@cython.cclass
class MyClass:
x : cython.int
def x_times_2(self):
x2 : cython.int
x2 = self.x * 2
return x2
```
This fails to compile (on 64-bit linux with Python 3.8.... | [
{
"body": "```cython\r\n@cython.dataclasses.dataclass\r\n@cython.cclass\r\nclass MyClass:\r\n x : cython.int\r\n\r\n def x_times_2(self):\r\n x2 : cython.int\r\n x2 = self.x * 2\r\n return x2\r\n```\r\n\r\nThis fails to compile (on 64-bit linux with Python 3.8.11 and Cython 3.0.0 Alph... | 5b4bc497ad04880d85c7cb64b8c6e6aa919ffdde | {
"head_commit": "4964de7d4b1a5e623717a277178e5ab0935da64e",
"head_commit_message": "Remove comment that relates to changes I didn't make",
"patch_to_review": "diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py\nindex bfe065171bb..493fd140c54 100644\n--- a/Cython/Compiler/ExprNodes.py\n+++ b... | [
{
"diff_hunk": "@@ -2160,7 +2155,7 @@ def _analyse_target_declaration(self, env, is_assignment_expression):\n self.entry.known_standard_library_import = \"\" # already exists somewhere and so is now ambiguous\n if not self.entry and self.annotation is not None:\n # name : type =... | a417483f52f362f992d1d68183edbdc262d1bfb1 | diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py
index bfe065171bb..7eec59542ae 100644
--- a/Cython/Compiler/ExprNodes.py
+++ b/Cython/Compiler/ExprNodes.py
@@ -2057,15 +2057,10 @@ def declare_from_annotation(self, env, as_target=False):
atype = error_type
vis... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} | |
cupy__cupy-6341@16e217d | cupy/cupy | Python | 6,341 | Make scipy.special ufuncs work with CuPy inputs | This PR makes it possible to pass CuPy arrays to `scipy.special` ufuncs. The actual implementation is dispatched to `cupyx.scipy.special` using `__array_ufunc__`.
Fixes https://github.com/cupy/cupy/issues/6158. | 2022-01-18T13:02:54Z | Support `scipy.special` with `__array_ufunc__`
### Description
`cupy.ndarray` implements `__array_ufunc__` interface, this allows NumPy ufuncs to accept CuPy arrays and it all just works. The majority of `scipy.special` functions are implemented as ufuncs and the same is true for `cupyx.scipy.special`. It would be gre... | @IvanYashchuk Just for my own curiosity: Do you know how `scipy.special` supports `__array_ufunc__`? Did they use the ufunc C APIs?
Yes, they use ufunc's C API ([`PyUFunc_FromFuncAndData`](https://numpy.org/devdocs/reference/c-api/ufunc.html?highlight=pyufunc_fromfuncanddata#c.PyUFunc_FromFuncAndData)) and they generat... | [
{
"body": "### Description\n\n`cupy.ndarray` implements `__array_ufunc__` interface, this allows NumPy ufuncs to accept CuPy arrays and it all just works. The majority of `scipy.special` functions are implemented as ufuncs and the same is true for `cupyx.scipy.special`. It would be great to support interoperabi... | ea1c18c139c1c57bd8e72d13da9d0c4459502bb1 | {
"head_commit": "16e217dca152ad265f6977f5b6d396e83a80ca35",
"head_commit_message": "Fix too long line",
"patch_to_review": "diff --git a/cupy/_core/core.pyx b/cupy/_core/core.pyx\nindex 9978d796488..35385b48d10 100644\n--- a/cupy/_core/core.pyx\n+++ b/cupy/_core/core.pyx\n@@ -1545,6 +1545,7 @@ cdef class ndarray... | [
{
"diff_hunk": "@@ -0,0 +1,42 @@\n+import numpy\n+import cupy\n+import cupyx.scipy.special\n+\n+from cupy import testing\n+import pytest\n+\n+try:\n+ import scipy.special\n+\n+ scipy_ufuncs = {\n+ f\n+ for f in scipy.special.__all__\n+ if isinstance(getattr(scipy.special, f), numpy.uf... | 580fc8ae4f8573cbab4f76ef1790847ff869e7a1 | diff --git a/cupy/_core/core.pyx b/cupy/_core/core.pyx
index 9978d796488..35385b48d10 100644
--- a/cupy/_core/core.pyx
+++ b/cupy/_core/core.pyx
@@ -1545,6 +1545,7 @@ cdef class ndarray:
numpy array.
"""
import cupy # top-level ufuncs
+ import cupyx.scipy.special # special ufuncs
... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "New Feature Additions"
} |
deepset-ai__haystack-7700@db145a3 | deepset-ai/haystack | Python | 7,700 | feat: Add options for what to do with missing metadata fields in `MetaFieldRanker` | ### Related Issues
- fixes #7691
- Adds param `missing_meta` to `MetaFieldRanker`:
```
:param missing_meta:
What to do with documents that are missing the sorting metadata field.
Possible values are:
- 'drop' will drop the documents entirely.
- 'top' wi... | 2024-05-15T15:00:23Z | `MetaFieldRanker`: allow different options for what to do with missing metadata field
**Is your feature request related to a problem? Please describe.**
This is not an immediately faced problem, but seems like something that would be undesired in the long run. Long story short, currently when `MetaFieldRanker` sorts b... | [
{
"body": "**Is your feature request related to a problem? Please describe.**\r\nThis is not an immediately faced problem, but seems like something that would be undesired in the long run. Long story short, currently when `MetaFieldRanker` sorts by the assigned metadata field, it puts any documents that are mis... | 23011c215eab03a8293ff2a1a622c539a5132517 | {
"head_commit": "db145a3d558c2096d05c740e6ce118f5f71da91e",
"head_commit_message": "Merge branch 'main' into metf_optionality",
"patch_to_review": "diff --git a/haystack/components/rankers/meta_field.py b/haystack/components/rankers/meta_field.py\nindex 964d4db974..5a91659de6 100644\n--- a/haystack/components/ra... | [
{
"diff_hunk": "@@ -227,12 +259,27 @@ def run(\n return {\"documents\": documents[:top_k]}\n \n if len(docs_missing_meta_field) > 0:\n- logger.warning(\n- \"The parameter <meta_field> is currently set to '{meta_field}' but the Documents with IDs {document_ids} don't... | a7ad6cd7b83889408602e6c02ca7f1000eab0418 | diff --git a/haystack/components/rankers/meta_field.py b/haystack/components/rankers/meta_field.py
index 964d4db974..b14b105141 100644
--- a/haystack/components/rankers/meta_field.py
+++ b/haystack/components/rankers/meta_field.py
@@ -43,6 +43,7 @@ def __init__(
top_k: Optional[int] = None,
ranking_mo... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "New Feature Additions"
} | |
deepset-ai__haystack-7721@338a7a8 | deepset-ai/haystack | Python | 7,721 | feat: add split_threshold to document splitter to avoid excessively short splits |
### Related Issues
- fixes [#7275](https://github.com/deepset-ai/haystack/issues/7275)
### Proposed Changes:
Pass a split_threshold to the document splitter, if the last chunk is small than the threshold, attach it to the previous one.
This avoids having small chunks of 2 or 3 words that are not meaningful ... | 2024-05-21T15:28:09Z | Add split_threshold option to DocumentSplitter
**Is your feature request related to a problem? Please describe.**
If I'm splitting documents at a length of 1000, but I have a document that has a length of 1100, I'd rather not split the document.
**Describe the solution you'd like**
I'd like to be able to specify a... | [
{
"body": "**Is your feature request related to a problem? Please describe.**\r\nIf I'm splitting documents at a length of 1000, but I have a document that has a length of 1100, I'd rather not split the document.\r\n\r\n**Describe the solution you'd like**\r\nI'd like to be able to specify a split_threshold whe... | 22289f590fc3191b9d7883d514441046b0b17764 | {
"head_commit": "338a7a860905a748d8725a0747eb5a9e7675f756",
"head_commit_message": "feat: add split_threshold to document splitter to avoid excessively small splits",
"patch_to_review": "diff --git a/haystack/components/preprocessors/document_splitter.py b/haystack/components/preprocessors/document_splitter.py\n... | [
{
"diff_hunk": "@@ -102,27 +106,34 @@ def _split_into_units(self, text: str, split_by: Literal[\"word\", \"sentence\", \"pa\n return units\n \n def _concatenate_units(\n- self, elements: List[str], split_length: int, split_overlap: int\n+ self, elements: List[str], split_length: int, s... | e8316ba1fd5994f8f9b5b04367118117a66ad074 | diff --git a/haystack/components/preprocessors/document_splitter.py b/haystack/components/preprocessors/document_splitter.py
index 294f375e9e..5117d80584 100644
--- a/haystack/components/preprocessors/document_splitter.py
+++ b/haystack/components/preprocessors/document_splitter.py
@@ -25,6 +25,7 @@ def __init__(
... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "New Feature Additions"
} | |
dask__dask-10765@7f7dada | dask/dask | Python | 10,765 | Improve exception for `validate_key` | - [x] Closes #10764
- [ ] Tests added / passed
- [x] Passes `pre-commit run --all-files`
The exception now indicates the index of the invalid key type and the traceback reveals the actual problem. The latter is important for nested tuples.
```
Traceback (most recent call last):
File "/Users/hendrikmakait/pr... | 2024-01-10T09:10:40Z | Exception from `validate_key` is misleading for composite keys
When validating a key tuple with an invalid component, the exception is currently not helpful for identifying the problem and might even be misleading:
```python
import numpy as np
from dask.core import validate_key
validate_key((1, np.int64(2), 3))
... | [
{
"body": "When validating a key tuple with an invalid component, the exception is currently not helpful for identifying the problem and might even be misleading:\r\n\r\n```python\r\nimport numpy as np\r\nfrom dask.core import validate_key\r\nvalidate_key((1, np.int64(2), 3))\r\n```\r\ncreates the following tra... | 63b6bb84015975c8466e80d1d498a293835ae936 | {
"head_commit": "7f7dadaa124d0c86bc64a00e80b35e55db38bb98",
"head_commit_message": "Improve exception",
"patch_to_review": "diff --git a/dask/core.py b/dask/core.py\nindex ef75ca563cd..4121a034c38 100644\n--- a/dask/core.py\n+++ b/dask/core.py\n@@ -218,9 +218,26 @@ def iskey(key: object) -> bool:\n \n \n def val... | [
{
"diff_hunk": "@@ -218,9 +218,26 @@ def iskey(key: object) -> bool:\n \n \n def validate_key(key: object) -> None:\n- \"\"\"Validate the format of a dask key.\"\"\"\n- if not iskey(key):\n- raise TypeError(f\"Unexpected key type {type(key)} (value: {key!r})\")\n+ \"\"\"Validate the format of a ... | 78ad7df73a12c2df1f25347d4fb2348226593634 | diff --git a/dask/core.py b/dask/core.py
index ef75ca563cd..e00e4fb8afc 100644
--- a/dask/core.py
+++ b/dask/core.py
@@ -218,9 +218,26 @@ def iskey(key: object) -> bool:
def validate_key(key: object) -> None:
- """Validate the format of a dask key."""
- if not iskey(key):
- raise TypeError(f"Unexpecte... | {
"difficulty": "medium",
"estimated_review_effort": 2,
"problem_domain": "Bug Fixes"
} | |
cupy__cupy-6208@f3641e9 | cupy/cupy | Python | 6,208 | Fix edge case compatibility in `cupy.eye()` | Fix #5704 | 2021-12-06T08:06:57Z | Edge cases of compatibility in `numpy.eye()`
These are discovered when running hypothesis-based Array API tests. For now I am just documenting these discoveries. I do not know if they are something we'd like to fix -- I'd need more time to look into them.
Case 1:
```python
>>> np.eye(0, k=9223372036854775808, dty... | [
{
"body": "These are discovered when running hypothesis-based Array API tests. For now I am just documenting these discoveries. I do not know if they are something we'd like to fix -- I'd need more time to look into them. \r\n\r\nCase 1:\r\n```python\r\n>>> np.eye(0, k=9223372036854775808, dtype=np.int8)\r\narr... | 54e10adbee3041c9a74d8d2cdc50149518fb2340 | {
"head_commit": "f3641e958e5f9f40520fe4607a9cfb8ef4ca9351",
"head_commit_message": "Update cupy/_creation/basic.py\n\nCo-authored-by: emcastillo <ecastill@preferred.jp>",
"patch_to_review": "diff --git a/cupy/_creation/basic.py b/cupy/_creation/basic.py\nindex e8095b2fa15..a5ad91cff22 100644\n--- a/cupy/_creatio... | [
{
"diff_hunk": "@@ -172,11 +169,12 @@ def test_empty_zero_sized_array_strides(self, order):\n b = cupy.empty((1, 0, 2), dtype='d', order=order)\n assert b.strides == a.strides\n \n+ @pytest.mark.parametrize('offset', [1, -1, 1<<63, -(1<<63)])",
"line": null,
"original_line": 172,
... | 6893d466e77075922088247c6436e2ad20b86bed | diff --git a/cupy/_creation/basic.py b/cupy/_creation/basic.py
index e8095b2fa15..a5ad91cff22 100644
--- a/cupy/_creation/basic.py
+++ b/cupy/_creation/basic.py
@@ -110,7 +110,9 @@ def eye(N, M=None, k=0, dtype=float, order='C'):
"""
if M is None:
M = N
- ret = zeros((N, M), dtype, order=order)
+ ... | {
"difficulty": "low",
"estimated_review_effort": 2,
"problem_domain": "Bug Fixes"
} | |
dask__dask-10750@0e209e1 | dask/dask | Python | 10,750 | Deprecate `npartitions='auto'` for set_index & sort_values | - [x] Closes #10736
- [x] Tests added / passed
- [x] Passes `pre-commit run --all-files`
| 2024-01-05T10:28:49Z | Deprecate ``npartitions="auto"`` for set_index and sort_values
The docs state that this makes a decision based on memory use
> If ‘auto’ then decide by memory use.
But that's just wrong
```
if npartitions == "auto":
repartition = True
npartitions = max(100, df.npartitions)
```
This i... | [
{
"body": "The docs state that this makes a decision based on memory use\r\n\r\n> If ‘auto’ then decide by memory use.\r\n\r\nBut that's just wrong\r\n\r\n```\r\n if npartitions == \"auto\":\r\n repartition = True\r\n npartitions = max(100, df.npartitions)\r\n```\r\n\r\nThis is very prohibitive... | 6d5b994cb58f295c27bd888de0f67c83ed568d3d | {
"head_commit": "0e209e103151a174a650be2e11c24c1aa80a49ca",
"head_commit_message": "Deprecate `npartitions='auto'` for set_index & sort_values",
"patch_to_review": "diff --git a/dask/dataframe/shuffle.py b/dask/dataframe/shuffle.py\nindex 270df6da4e1..87fc85f93b2 100644\n--- a/dask/dataframe/shuffle.py\n+++ b/da... | [
{
"diff_hunk": "@@ -569,19 +569,19 @@ def _set_index(i, df, idx):\n return df.set_index(idx).divisions\n \n \n-def test_set_index_reduces_partitions_small(shuffle_method):\n+def test_set_index_not_reduce_partitions_small(shuffle_method):",
"line": null,
"original_line": 572,
"original_start_line... | 76b79ee796b19f5fcfdce8b15e0334b82ad923cd | diff --git a/dask/dataframe/shuffle.py b/dask/dataframe/shuffle.py
index 270df6da4e1..663e18a1a6b 100644
--- a/dask/dataframe/shuffle.py
+++ b/dask/dataframe/shuffle.py
@@ -166,6 +166,11 @@ def sort_values(
return df.map_partitions(sort_function, **sort_kwargs)
if npartitions == "auto":
+ warning... | {
"difficulty": "medium",
"estimated_review_effort": 2,
"problem_domain": "Code Refactoring / Architectural Improvement"
} | |
cupy__cupy-5978@53682ee | cupy/cupy | Python | 5,978 | Fix `ravel` for strides 0 | Always enforce the copy if the array is neither c- or f-contiguous.
Closes #5972 | 2021-11-01T08:17:54Z | `ravel` not working when stride is 0
### Description
When having a scalar that is broadcasted, `.ravel()` does not create a new array with copies of the scalar, but returns the same view.
### To Reproduce
```
>>> import numpy
>>> a=numpy.array([1])
>>> b=numpy.broadcast_to(a, (10,))
>>> b.strides
(0,)
>>> ... | [
{
"body": "### Description\n\nWhen having a scalar that is broadcasted, `.ravel()` does not create a new array with copies of the scalar, but returns the same view.\r\n\r\n\n\n### To Reproduce\n\n```\r\n>>> import numpy\r\n>>> a=numpy.array([1])\r\n>>> b=numpy.broadcast_to(a, (10,))\r\n>>> b.strides\r\n(0,)\r\n... | afec5a86361cf7650f261c62a331c7f2e5a38c1b | {
"head_commit": "53682ee18a80eb3947518c929460902ca95ae5df",
"head_commit_message": "review changes",
"patch_to_review": "diff --git a/cupy/_core/core.pyx b/cupy/_core/core.pyx\nindex 84e90649b16..ebd57cdefb8 100644\n--- a/cupy/_core/core.pyx\n+++ b/cupy/_core/core.pyx\n@@ -728,7 +728,8 @@ cdef class ndarray:\n ... | [
{
"diff_hunk": "@@ -170,6 +170,31 @@ def test_ravel3(self, xp, order):\n a = xp.asfortranarray(a)\n return a.ravel(order)\n \n+ @testing.for_orders('CFA')\n+ @testing.numpy_cupy_array_equal()\n+ def test_ravel_non_contiguous(self, xp, order):\n+ a = xp.arange(10)[::2]\n+ a... | 93cfba6fcddc80256f3ea0b77d88ab37791e2831 | diff --git a/cupy/_core/core.pyx b/cupy/_core/core.pyx
index 84e90649b16..ebd57cdefb8 100644
--- a/cupy/_core/core.pyx
+++ b/cupy/_core/core.pyx
@@ -728,7 +728,8 @@ cdef class ndarray:
:meth:`numpy.ndarray.ravel`
"""
- return _manipulation._ndarray_ravel(self, order)
+ return _inter... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} | |
dask__dask-10723@09b7b68 | dask/dask | Python | 10,723 | Pandas 3.0 deprecations and migration prep for dask-expr | - [x] Closes #10682
- [x] Tests added / passed
- [x] Passes `pre-commit run --all-files`
Happy to split into different PRs per deprecation; otherwise split by commit for now. | 2023-12-19T12:32:01Z | DEPR: pandas 3.0 deprecations and the migration to dask-expr
pandas deprecated a bunch of things in the 2.x series that will be removed in pandas 3.0. Some of these things are changes in behaviour that are hard to replace but other things are just syntactic sugar. Examples like this are:
- [ ] GroupBy.fillna -> you ca... | [
{
"body": "pandas deprecated a bunch of things in the 2.x series that will be removed in pandas 3.0. Some of these things are changes in behaviour that are hard to replace but other things are just syntactic sugar. Examples like this are:\n\n- [ ] GroupBy.fillna -> you can either use ffill/bfill or a regular fi... | 31b26dfa4bf15f23a7070155ac67e6ba285de76f | {
"head_commit": "09b7b686c6983362dd4796d89d9f3d26226e677b",
"head_commit_message": "Deprecate axis in GroupBy.shift/idxmax/idxmin",
"patch_to_review": "diff --git a/dask/dataframe/core.py b/dask/dataframe/core.py\nindex 7cddc42d933..fc3111d66f2 100644\n--- a/dask/dataframe/core.py\n+++ b/dask/dataframe/core.py\n... | [
{
"diff_hunk": "@@ -3735,6 +3735,7 @@ def resample(self, rule, closed=None, label=None):\n \n return Resampler(self, rule, closed=closed, label=label)\n \n+ @_deprecated(message=\"Will be removed in a future version.\")",
"line": null,
"original_line": 3738,
"original_start_line": null,
... | 3c1f369ffbca11dfbd788a63f60726918088c8c0 | diff --git a/dask/dataframe/core.py b/dask/dataframe/core.py
index 7cddc42d933..03d4512251f 100644
--- a/dask/dataframe/core.py
+++ b/dask/dataframe/core.py
@@ -3735,6 +3735,12 @@ def resample(self, rule, closed=None, label=None):
return Resampler(self, rule, closed=closed, label=label)
+ @_deprecated(
... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Dependency Updates & Env Compatibility"
} | |
cython__cython-4844@4ee514c | cython/cython | Python | 4,844 | Avoid raising StopIteration in __next__ | Fixes https://github.com/cython/cython/issues/3447 | 2022-06-16T19:52:24Z | Performance of `__next__` (efficiently signaling end of iteration)
I'm trying to write a custom collection class, and am struggling to write an iterator that is competitive with the iterator of a built-in tuple.
The benchmark:
```
timeit.timeit(lambda: sum(1 for my_tuple in iter_tuples() for item in my_tuple))
``... | With hand-written C code for the iterator class, I end up 5% faster than the builtin tuple.
Have you tried a generator function?
I've created a standalone benchmark and attached it: [cython-bench.zip](https://github.com/cython/cython/files/4361229/cython-bench.zip)
No matter which Python way of writing an iterator I... | [
{
"body": "I'm trying to write a custom collection class, and am struggling to write an iterator that is competitive with the iterator of a built-in tuple.\r\n\r\nThe benchmark:\r\n```\r\ntimeit.timeit(lambda: sum(1 for my_tuple in iter_tuples() for item in my_tuple))\r\n```\r\nPreviously `iter_tuples()` was yi... | f753deecd09e011a1bc276b78ccc0f1c0ad67f09 | {
"head_commit": "4ee514c532f67497d3a8cd8ab322ce542db0fb55",
"head_commit_message": "Fix compiling Code.py",
"patch_to_review": "diff --git a/Cython/Compiler/Code.pxd b/Cython/Compiler/Code.pxd\nindex e17e0fb1ded..59779f8bcaa 100644\n--- a/Cython/Compiler/Code.pxd\n+++ b/Cython/Compiler/Code.pxd\n@@ -54,6 +54,7 @... | [
{
"diff_hunk": "@@ -2332,8 +2335,17 @@ def put_pymethoddef_wrapper(self, entry):\n if method_noargs in method_flags:\n # Special NOARGS methods really take no arguments besides 'self', but PyCFunction expects one.\n func_cname = Naming.method_wrapper_prefix + func_cna... | a34156908a609ae01fdb90c6ee019a78d83d3d95 | diff --git a/Cython/Compiler/Code.pxd b/Cython/Compiler/Code.pxd
index e17e0fb1ded..59779f8bcaa 100644
--- a/Cython/Compiler/Code.pxd
+++ b/Cython/Compiler/Code.pxd
@@ -54,6 +54,7 @@ cdef class FunctionState:
cdef public object closure_temps
cdef public bint should_declare_error_indicator
cdef public bin... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "Performance Optimizations"
} |
deepset-ai__haystack-7653@ce19f65 | deepset-ai/haystack | Python | 7,653 | feat: widen support of env vars in OpenAI components | ### Related Issues
- fixes #7610
### Proposed Changes:
Now you can change the timeout and max retries of your OpenAI clients (`OpenAIDocumentEmbedder`, `OpenAITextEmbedder`, `OpenAIGenerator` and `OpenAIChatGenerator`) just by using the `OPENAI_TIMEOUT` and `OPENAI_MAX_RETRIES` environment variables.
### Ho... | 2024-05-06T11:48:51Z | Add enviroment variable for openai timeout, backoff and max retries
**Is your feature request related to a problem? Please describe.**
In version 1, haystack allows to set three environment variables to manage:
* OPENAI_TIMEOUT
* OPENAI_MAX_RETRIES
* OPENAI_BACKOFF
It's useful also for the versione 2.0 | Working on it.
@nickprock, I've been locking for this environment variables on the v1.x and v1.25.x branches and cannot find any reference to them, could you give me more info please.
In 1.25 there are these environment variables
```
# Any remote API (OpenAI, Cohere etc.)
HAYSTACK_REMOTE_API_BACKOFF_SEC = "HAYSTAC... | [
{
"body": "**Is your feature request related to a problem? Please describe.**\r\nIn version 1, haystack allows to set three environment variables to manage:\r\n* OPENAI_TIMEOUT\r\n* OPENAI_MAX_RETRIES\r\n* OPENAI_BACKOFF\r\n\r\nIt's useful also for the versione 2.0",
"number": 7610,
"title": "Add enviro... | af53e8430d93e1bca9a411cf162d72ad41dd6c02 | {
"head_commit": "ce19f65cbab5d853292d50bb0e61c5e2ccc6441a",
"head_commit_message": "reverse changes to telemetry/_enviroment.py",
"patch_to_review": "diff --git a/haystack/components/embedders/openai_document_embedder.py b/haystack/components/embedders/openai_document_embedder.py\nindex 4bc189dd4f..b129f68ea9 10... | [
{
"diff_hunk": "@@ -2,13 +2,17 @@\n #\n # SPDX-License-Identifier: Apache-2.0\n \n+import os\n from typing import Any, Dict, List, Optional\n \n from openai import OpenAI\n \n from haystack import component, default_from_dict, default_to_dict\n from haystack.utils import Secret, deserialize_secrets_inplace\n \n... | 411733cdda4e71c7fcb6dfcd4c1f779c64c9910f | diff --git a/haystack/components/embedders/openai_document_embedder.py b/haystack/components/embedders/openai_document_embedder.py
index 4bc189dd4f..b129f68ea9 100644
--- a/haystack/components/embedders/openai_document_embedder.py
+++ b/haystack/components/embedders/openai_document_embedder.py
@@ -2,6 +2,7 @@
#
# SPD... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "New Feature Additions"
} |
cython__cython-4678@ae9832f | cython/cython | Python | 4,678 | Allow fused function pointer return type | Fixes https://github.com/cython/cython/issues/4644
For fused functions it makes sense that the return type is ignored
(a function can't be specialized based on return type alone) but
for function pointers the return type should be included (since
such a pointer might be an argument to a fused function) | 2022-03-12T18:03:37Z | [BUG] Fused function with function pointer parameter that has a struct argument causes a compiler crash
**describe the bug**
I'm developing some bindings where there are a lot of C functions that basically have the signature (error_code)(*getter)(some_c_struct*, primitive_value* value_ptr)
That take a pointer, retrie... | Oh, here is how to reproduce and the error:
cythonize -i -3 fused_function_pointer.pyx
...
```
Error compiling Cython file:
------------------------------------------------------------
...
coords
# a helper function that takes a Python object that must be a Cython class containing a c_struct and a C functi... | [
{
"body": "**describe the bug**\r\nI'm developing some bindings where there are a lot of C functions that basically have the signature (error_code)(*getter)(some_c_struct*, primitive_value* value_ptr)\r\nThat take a pointer, retrieve a value and either store that value in the provided pointer or return an error... | 7537910a2d2e3892359ef639fe9262f017634461 | {
"head_commit": "ae9832fd12f5b78f744f46568d9cb18118eaa6e6",
"head_commit_message": "Add a multi-level function pointer test",
"patch_to_review": "diff --git a/Cython/Compiler/PyrexTypes.py b/Cython/Compiler/PyrexTypes.py\nindex 32ee0ad7e84..05ca43e87b6 100644\n--- a/Cython/Compiler/PyrexTypes.py\n+++ b/Cython/Co... | [
{
"diff_hunk": "@@ -2757,10 +2757,11 @@ def find_cpp_operation_type(self, operator, operand_type=None):\n return self.base_type.find_cpp_operation_type(operator, operand_type)\n return None\n \n- def get_fused_types(self, result=None, seen=None, is_pointer=False):\n- # The is_point... | 7bbdf99906d9ab37ec77576349fa3bebc99008c4 | diff --git a/Cython/Compiler/PyrexTypes.py b/Cython/Compiler/PyrexTypes.py
index 32ee0ad7e84..147d166b74e 100644
--- a/Cython/Compiler/PyrexTypes.py
+++ b/Cython/Compiler/PyrexTypes.py
@@ -78,7 +78,7 @@ def __deepcopy__(self, memo):
"""
return self
- def get_fused_types(self, result=None, seen=No... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
deepset-ai__haystack-7599@72fe37d | deepset-ai/haystack | Python | 7,599 | feat: add page_number to metadata in DocumentSplitter | ### Related Issues
- fixes #6705
### Proposed Changes:
<!--- In case of a bug: Describe what caused the issue and how you solved it -->
<!--- In case of a feature: Describe what did you add and how it works -->
I updated the `DocumentSplitter` methods so that it adds the "page_number" field to the metadat... | 2024-04-25T19:09:50Z | feat: Add `page_number` to meta of Documents in `DocumentSplitter`
**Is your feature request related to a problem? Please describe.**
In Haystack v1 we had an option in the Preprocessor to add the original `page_number` to a Document's meta data when it was split into a chunk. This feature made down stream application... | This issue https://github.com/deepset-ai/haystack/issues/6706 is related since we currently do not keep page break information when converting a PDF file to a Haystack Document.
Hi @sjrl :)
This is my first issue. I'm trying to understand the requisites better. It seems to me that to keep the page number and the as... | [
{
"body": "**Is your feature request related to a problem? Please describe.**\r\nIn Haystack v1 we had an option in the Preprocessor to add the original `page_number` to a Document's meta data when it was split into a chunk. This feature made down stream applications of visualizing the retrieved text from origi... | 8d04e530da24b5e5c8c11af29829714eeea47db2 | {
"head_commit": "72fe37d032fd17dcfd86493f7821582249fcae75",
"head_commit_message": "Update haystack/components/preprocessors/document_splitter.py\n\nCo-authored-by: David S. Batista <dsbatista@gmail.com>",
"patch_to_review": "diff --git a/.gitignore b/.gitignore\nindex 063a0e7661..3d5086f12e 100644\n--- a/.gitig... | [
{
"diff_hunk": "@@ -0,0 +1,10 @@\n+---\n+highlights: >\n+ Add the \"page_number\" field to the metadata of all output documents.\n+\n+enhancements:\n+ - |\n+ Now the DocumentSplitter adds the \"page_number\" field to the metadata of all output documents to keep track of the page of the original document ... | 4903a8e2ac5050688b7bb072981fd5843f1c6b59 | diff --git a/haystack/components/preprocessors/document_splitter.py b/haystack/components/preprocessors/document_splitter.py
index adea7cc3ce..033f55a89a 100644
--- a/haystack/components/preprocessors/document_splitter.py
+++ b/haystack/components/preprocessors/document_splitter.py
@@ -1,5 +1,5 @@
from copy import dee... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "New Feature Additions"
} |
cython__cython-4660@2149322 | cython/cython | Python | 4,660 | Fix ctypedefed bint | Fixes #3066
Finalisation of the work in #3080
| 2022-02-25T09:20:29Z | Cython incorrectly casts with ctypedef and bint
Given the following code:
```
ctypedef bint mybool
cdef f():
cdef mybool c
cdef mybool x
c = True
x = True
x = not x if c else x
print(x)
```
Results in this C code:
```
/* "test.pyx":3
* ctypedef bint... | Yes, that looks wrong. I guess we're too strict about special-casing `bint`, and should also include typedefs there. PR welcome that fixes up at least some of those places. Look for `c_bint_type`, mostly.
I would like to take a stab at this issue, I may need some help though @scoder.
1. Correct me if I'm wrong, but `... | [
{
"body": "Given the following code:\r\n\r\n```\r\nctypedef bint mybool\r\n\r\ncdef f():\r\n cdef mybool c\r\n cdef mybool x\r\n c = True\r\n x = True\r\n x = not x if c else x\r\n print(x)\r\n```\r\n\r\nResults in this C code:\r\n\r\n```\r\n/* \"test.pyx\":3\r\n * ctyp... | 97b8a0b9e9d9599f52d810b6f1ed52ebc1796918 | {
"head_commit": "2149322ae8d828eab64898637527e71e3dc8daff",
"head_commit_message": "independent_spanning_type.pyx: remove Werror",
"patch_to_review": "diff --git a/Cython/Compiler/PyrexTypes.py b/Cython/Compiler/PyrexTypes.py\nindex 32ee0ad7e84..1c329fc7345 100644\n--- a/Cython/Compiler/PyrexTypes.py\n+++ b/Cyth... | [
{
"diff_hunk": "@@ -4929,9 +4929,10 @@ def independent_spanning_type(type1, type2):\n type1 = type1.ref_base_type\n else:\n type2 = type2.ref_base_type\n- if type1 == type2:\n+ if type1.resolve() == type2.resolve():",
"line": null,
"original_line": 4932,
"origin... | d1c3eb4ad325e24b25c5b711fcb252452a39a708 | diff --git a/Cython/Compiler/PyrexTypes.py b/Cython/Compiler/PyrexTypes.py
index 32ee0ad7e84..d4e47c57022 100644
--- a/Cython/Compiler/PyrexTypes.py
+++ b/Cython/Compiler/PyrexTypes.py
@@ -4929,14 +4929,19 @@ def independent_spanning_type(type1, type2):
type1 = type1.ref_base_type
else:
... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
cupy__cupy-5824@3584434 | cupy/cupy | Python | 5,824 | Update upgrade guide | Closes #5766
Refs #5818 (keeping this issue open as this PR is not covering all changes in v10)
Auto-backport to v9 should fail, I'll take care of it. | 2021-10-02T10:41:19Z | Issue about the API of NCCL
Hi,
It seems that the API of NCCL described in the document, like `cupy.cuda.nccl`, is not working in the latest Cupy. It will throw an import error saying `cupy.cuda `does not have `nccl`. After checking the source code, I found a workaround is to `import cupy_backends `, then change a... | `cupy.cuda.nccl` should be alive as an alias to `cupy_backends.cuda.libs.nccl` even in the latest CuPy. I suspect your environment is in a mess because of some reason. Would you try to reinstall CuPy and see if it works?
Starting in CuPy v9, you need to do `import cupy.cuda.nccl` instead of `import cupy.cuda` explicitl... | [
{
"body": "\r\nHi,\r\n\r\nIt seems that the API of NCCL described in the document, like `cupy.cuda.nccl`, is not working in the latest Cupy. It will throw an import error saying `cupy.cuda `does not have `nccl`. After checking the source code, I found a workaround is to `import cupy_backends `, then change all ... | ec0a5aa7351372131fa770c53434cfa212a2f5af | {
"head_commit": "3584434b01f54a658bf5e18dd6f344361e4adc31",
"head_commit_message": "update upgrade guide",
"patch_to_review": "diff --git a/docs/source/upgrade.rst b/docs/source/upgrade.rst\nindex 6cc5fb6d508..f3dd4dcad2d 100644\n--- a/docs/source/upgrade.rst\n+++ b/docs/source/upgrade.rst\n@@ -7,17 +7,22 @@ Thi... | [
{
"diff_hunk": "@@ -106,6 +111,17 @@ NCCL and cuDNN No Longer Included in Wheels\n NCCL and cuDNN shared libraires are no longer included in wheels (see `#4850 <https://github.com/cupy/cupy/issues/4850>`_ for discussions). \n You can manually install them after installing wheel if you don't have a previous inst... | 6a7d6a86519d2db39283d3a07812b515a5372e55 | diff --git a/docs/source/upgrade.rst b/docs/source/upgrade.rst
index 6cc5fb6d508..a5c53ce0f19 100644
--- a/docs/source/upgrade.rst
+++ b/docs/source/upgrade.rst
@@ -7,17 +7,22 @@ This is a list of changes introduced in each release that users should be aware
CuPy v10
========
-Dropping CUDA 9.2 Support
------------... | {
"difficulty": "low",
"estimated_review_effort": 1,
"problem_domain": "Bug Fixes"
} |
cython__cython-4551@e11c002 | cython/cython | Python | 4,551 | Document cython.compile | Fixes #2770.
| 2022-01-01T10:01:07Z | Document @cython.compile
Hi,
I was wondering whethter there is a way, or it is possible to add a way, to do something like:
```python
from cython import cythonize, other, cython, magics
@cythonize # Decorator of interest
@other
@cython
@magics
def slow_function_at_work():
# omg so slow
# slow fu... | Looks like `@cython.compile` is undocumented, that's what you want. It should be mentioned [here](https://github.com/cython/cython/blob/master/docs/src/userguide/source_files_and_compilation.rst), preferably somewhere close to `@cython.inline`.
Sweet, thanks!
It looks like `RuntimeCompiledFunction` in fact uses `cyt... | [
{
"body": "Hi,\r\n\r\nI was wondering whethter there is a way, or it is possible to add a way, to do something like:\r\n```python\r\nfrom cython import cythonize, other, cython, magics\r\n\r\n@cythonize # Decorator of interest\r\n@other \r\n@cython\r\n@magics\r\ndef slow_function_at_work():\r\n # omg so s... | 316a3fb1fa3c2a010a60696f56893ff5dd99fbd0 | {
"head_commit": "e11c0025e5e9776f336e6c97530f433203ba38b0",
"head_commit_message": "Document cython.compile",
"patch_to_review": "diff --git a/docs/src/userguide/source_files_and_compilation.rst b/docs/src/userguide/source_files_and_compilation.rst\nindex b5855609772..e61bae7a0d6 100644\n--- a/docs/src/userguide... | [
{
"diff_hunk": "@@ -605,6 +605,34 @@ Unbound variables are automatically pulled from the surrounding local\n and global scopes, and the result of the compilation is cached for\n efficient re-use.\n \n+Compiling with ``cython.compile``\n+=================================\n+\n+Cython supports transpartent compili... | 4915f88c51978de5e2551214f89d3c62791d3ab6 | diff --git a/docs/src/userguide/source_files_and_compilation.rst b/docs/src/userguide/source_files_and_compilation.rst
index b5855609772..904c67b1ac2 100644
--- a/docs/src/userguide/source_files_and_compilation.rst
+++ b/docs/src/userguide/source_files_and_compilation.rst
@@ -605,6 +605,35 @@ Unbound variables are auto... | {
"difficulty": "low",
"estimated_review_effort": 1,
"problem_domain": "Documentation Updates"
} |
deepset-ai__haystack-7556@4fe77b0 | deepset-ai/haystack | Python | 7,556 | fix(JsonSchemaValidator): fix recursive loop and general LLM (claude, mistral...) compatibility | ### Related Issues
- fixes https://github.com/deepset-ai/haystack/issues/7457 https://github.com/deepset-ai/haystack/issues/7455
### Proposed Changes:
- Claude Compatibility: modified the behaviour so that (i) error template is now a single message with generated json, error and schema (ii) make it so that val... | 2024-04-17T14:17:24Z | JsonSchemaValidator: unintended primitive value conversion in `_recursive_json_to_object` method
**Describe the bug**
The current implementation of the `_recursive_json_to_object` method within the `JsonSchemaValidator` class inadvertently converts primitive string values to their respective data types (e.g., conv... | [
{
"body": "\r\n**Describe the bug**\r\n\r\nThe current implementation of the `_recursive_json_to_object` method within the `JsonSchemaValidator` class inadvertently converts primitive string values to their respective data types (e.g., converting numeric strings to integers) when processing JSON content. This b... | d80e01492be17637bc9ef5dda2f43bce77b541eb | {
"head_commit": "4fe77b08e66e31905497cd7dbe9e780feb470271",
"head_commit_message": "fix test",
"patch_to_review": "diff --git a/haystack/components/validators/json_schema.py b/haystack/components/validators/json_schema.py\nindex 109b0ad341..75661688af 100644\n--- a/haystack/components/validators/json_schema.py\n... | [
{
"diff_hunk": "@@ -142,18 +143,22 @@ def run(\n else:\n validate(instance=content, schema=validation_schema)\n \n- return {\"validated\": messages}\n+ return {\"validated\": [last_message]}",
"line": 177,
"original_line": 146,
"original_star... | 1cc2d082b137395bd6675f7fb523f8a71a164915 | diff --git a/haystack/components/validators/json_schema.py b/haystack/components/validators/json_schema.py
index 8f1f8e4df3..fb2c11b41c 100644
--- a/haystack/components/validators/json_schema.py
+++ b/haystack/components/validators/json_schema.py
@@ -13,6 +13,20 @@
from jsonschema import ValidationError, validate
... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "Bug Fixes"
} | |
dask__dask-10454@aee5704 | dask/dask | Python | 10,454 | Add documentation for hive partitioning | - Adds much-needed documentation on hive partitioning
- Moves ``aggregate_files`` from "pre-deprecation" to "experimental"
- I seriously doubt we will want to remove the option any time soon. However, I'm still not 100% happy with it yet.
Closes #10406
| 2023-08-21T21:37:19Z | to_parquet partitioned by 'date'
I'm trying to save a dask dataframe `to_parquet` and partition it by date. The system won't allow the naming of the file `date=2022-01-01 00:00:00`.
```
dates = pd.DataFrame({'date':pd.date_range(start='2022-01-01', end='2022-01-31', freq='D')})
ddata = dd.from_pandas(dates, npartit... | Thanks for the report @marcdelabarrera! I cannot reproduce on my end, so I'm thinking this is probably specific to windows. Can you confirm if you are using the "pyarrow" engine (by specifying `engine="pyarrow"`)?
Thank you for the reply. @rjzamora.
I tried with `pyarrow` and I am getting the same error. I tried t... | [
{
"body": "I'm trying to save a dask dataframe `to_parquet` and partition it by date. The system won't allow the naming of the file `date=2022-01-01 00:00:00`. \r\n```\r\ndates = pd.DataFrame({'date':pd.date_range(start='2022-01-01', end='2022-01-31', freq='D')})\r\nddata = dd.from_pandas(dates, npartitions=1)\... | 9f7d55705f0eb74a172f5fdc3690aa65fbe21762 | {
"head_commit": "aee5704d242b457ad1a1f959db08cfe33031d923",
"head_commit_message": "fix typo",
"patch_to_review": "diff --git a/dask/dataframe/io/parquet/core.py b/dask/dataframe/io/parquet/core.py\nindex f00accde907..5db293f4470 100644\n--- a/dask/dataframe/io/parquet/core.py\n+++ b/dask/dataframe/io/parquet/co... | [
{
"diff_hunk": "@@ -0,0 +1,227 @@\n+.. _dataframe.hive:\n+\n+Using Hive Partitioning with Dask\n+=================================\n+\n+.. currentmodule:: dask.dataframe\n+\n+It is sometimes useful to write your dataset with a hive-like directory scheme.\n+For example, if your dataframe contains ``'year'`` and ... | 414dc46e720eb1ce9cf031127213cc58802ce7e8 | diff --git a/dask/dataframe/io/parquet/core.py b/dask/dataframe/io/parquet/core.py
index f00accde907..584279e7382 100644
--- a/dask/dataframe/io/parquet/core.py
+++ b/dask/dataframe/io/parquet/core.py
@@ -317,10 +317,8 @@ def read_parquet(
set to 'infer' or 'adaptive'. Default may be engine-dependant, but is
... | {
"difficulty": "low",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
cython__cython-4629@1b3a0b1 | cython/cython | Python | 4,629 | cython, cythonize commands return error when file does not exist | cython and cythonize commands return No such file or directory error when passed file does not exist.
Fixes #4628
| 2022-02-08T18:32:21Z | [BUG] cython and cythonize commands does not error out when file does not exist
**Describe the bug**
All standard linux commands print out error when file is not present:
```
$ ls missing_file
ls: missing_file: No such file or directory
$ cat missing_file
cat: missing_file: No such file or directory
$ python3.... | [
{
"body": "**Describe the bug**\r\nAll standard linux commands print out error when file is not present:\r\n\r\n```\r\n$ ls missing_file\r\nls: missing_file: No such file or directory\r\n$ cat missing_file\r\ncat: missing_file: No such file or directory\r\n$ python3.9 missing_file\r\n/usr/local/bin/python3.9: c... | c900b6a587801aa3efc918809e53d6c33bc8ed73 | {
"head_commit": "1b3a0b1f2f0f1c33d89e14760186a084fae5a786",
"head_commit_message": "Try to fix failing tests",
"patch_to_review": "diff --git a/Cython/Build/Cythonize.py b/Cython/Build/Cythonize.py\nindex 1f79589f875..49df02abe13 100644\n--- a/Cython/Build/Cythonize.py\n+++ b/Cython/Build/Cythonize.py\n@@ -1,6 +... | [
{
"diff_hunk": "@@ -543,6 +543,7 @@ def print_captured(captured, output, header_line=None):\n if captured:\n if header_line:\n output.write(header_line)\n+ captured = captured.encode(errors='replace').decode()",
"line": null,
"original_line": 546,
"original_start_line"... | 5ec1f877e9c7e01d431461bd7ed5e3813310990a | diff --git a/Cython/Build/Cythonize.py b/Cython/Build/Cythonize.py
index ab18a12bc71..179c0406025 100644
--- a/Cython/Build/Cythonize.py
+++ b/Cython/Build/Cythonize.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
-from __future__ import absolute_import
+from __future__ import absolute_import, print_function
import os
... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} | |
cython__cython-4515@e517231 | cython/cython | Python | 4,515 | Fix class pointer annotations | Fixes #4514
It looks like annotations attached to namenodes weren't correctly
processed with "InterpretCompilerDirectivesTransform" | 2021-12-22T19:12:33Z | [BUG] Compilation fails when class attribute is annotated using `cython.pointer()`
**Describe the bug**
Compiler fails to compile when class attribute annotation is using `cython.pointer()`.
**To Reproduce**
Code to reproduce the behaviour:
```cython
import cython
A = cython.declare(cython.int, 3)
@cython.... | [
{
"body": "**Describe the bug**\r\nCompiler fails to compile when class attribute annotation is using `cython.pointer()`.\r\n\r\n**To Reproduce**\r\nCode to reproduce the behaviour:\r\n```cython\r\nimport cython\r\n\r\nA = cython.declare(cython.int, 3)\r\n\r\n@cython.cclass\r\nclass Test:\r\n test: cython.po... | 958df064d6c95be73bb5323de1dfa405530665f0 | {
"head_commit": "e517231f478b86c64e42f4e8cb1ed0fdb181c311",
"head_commit_message": "Fix class pointer annotations\n\nFixes #4514\n\nIt looks like annotations attached to namenodes weren't correctly\nprocessed with \"InterpretCompilerDirectivesTransform\"",
"patch_to_review": "diff --git a/Cython/Compiler/ExprNod... | [
{
"diff_hunk": "@@ -1928,6 +1929,7 @@ class NameNode(AtomicExprNode):\n allow_null = False\n nogil = False\n inferred_type = None\n+ annotation = None",
"line": null,
"original_line": 1932,
"original_start_line": null,
"path": "Cython/Compiler/ExprNodes.py",
"start_line": null... | 099d23b25c73f75ff4e3842fc79e72f6b26af101 | diff --git a/Cython/Compiler/ParseTreeTransforms.py b/Cython/Compiler/ParseTreeTransforms.py
index 2edde9ba4bd..0f157824966 100644
--- a/Cython/Compiler/ParseTreeTransforms.py
+++ b/Cython/Compiler/ParseTreeTransforms.py
@@ -913,6 +913,8 @@ def visit_SingleAssignmentNode(self, node):
return node
def vis... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} | |
cython__cython-4436@3651eb5 | cython/cython | Python | 4,436 | Make self argument for binops typed | The type for the self argument for binops depends on the compile directives. Therefore it needs a set of type slots that depends on the compiler directives.
I've therefore got rid of the big static list of typeslots in TypeSlots.py in favour of a class that defines them all (and
can be initialized with suitable com... | 2021-10-31T15:25:15Z | [BUG] __add__ method gets Python object not cython object as self.
**Describe the bug**
This may be working as intended if so I will have to find a workaround for it but I just wanted to confirm first.
The `__eq__` method of a class in cython is given the cython version of the class even if called from python.
I wou... | Thanks - I think this is something we know about but it probably does need fixing. It applies to all of the binary operators.
In the past this was deliberate and [documented](https://cython.readthedocs.io/en/latest/src/userguide/special_methods.html#arithmetic-methods) because add could be called with either `self` ... | [
{
"body": "**Describe the bug**\r\nThis may be working as intended if so I will have to find a workaround for it but I just wanted to confirm first.\r\nThe `__eq__` method of a class in cython is given the cython version of the class even if called from python.\r\nI would expect this behaviour to apply to all d... | c69992aa4eb0f7b4529f776820d20b8c66486972 | {
"head_commit": "3651eb58cb3c0bcbf981f173b4be7743f9c0d134",
"head_commit_message": "Added documentation in \"migrating\" guide",
"patch_to_review": "diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py\nindex 99b2f0028ff..713adb3bb2d 100644\n--- a/Cython/Compiler/ModuleNode.py\n+++ b/Cython... | [
{
"diff_hunk": "@@ -5369,7 +5369,8 @@ def generate_type_ready_code(entry, code, bases_tuple_cname=None, check_heap_typ\n ))\n # Still need to inherit buffer methods since PyType_Ready() didn't do it for us.\n for buffer_method_name in (\"__getbuffer__\", \"__relea... | 881bcb57c7a52cd29e6ecc8544e1321cdc76eafa | diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py
index 99b2f0028ff..713adb3bb2d 100644
--- a/Cython/Compiler/ModuleNode.py
+++ b/Cython/Compiler/ModuleNode.py
@@ -1437,7 +1437,7 @@ def generate_typeobj_definitions(self, env, code):
warning(scope.parent_type.pos,
... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "Bug Fixes"
} |
dask__dask-10356@fc970c8 | dask/dask | Python | 10,356 | Speed up dask.bag.Bag.random_sample | Closes #10351
```python
%timeit random_state_data_python(1, 0)
%timeit random_state_data_python(10, 0)
%timeit random_state_data_python(100, 0)
%timeit random_state_data_python(1000, 0)
```
Before:
```
265 µs ± 1.72 µs per loop (mean ± std. dev. of 7 runs, 1,000 loops each)
2.64 ms ± 16.8 µs per loop (mean ± ... | 2023-06-14T10:53:34Z | Parallel random_state_data_python
I've noticed my workers spend a lot of time on dask/bag/core.py random_sample computing the list comprehension in random_state_data_python. Currently this has to happen serially, as python.random.Random increments the state serially. However there are other sources of randomness (like ... | I transferred this to the dask/dask repo since it doesn't require a distributed cluster.
My take on this is that for most practical purposes this is not required to be reproducible. At the very least the default is not strictly reproducible if the user does not provide a random seed. Accepting a random seed and ensu... | [
{
"body": "I've noticed my workers spend a lot of time on dask/bag/core.py random_sample computing the list comprehension in random_state_data_python. Currently this has to happen serially, as python.random.Random increments the state serially. However there are other sources of randomness (like SystemRandom) t... | bdc71ba5a4ad7bfb0265a52a1b816936604845fe | {
"head_commit": "fc970c8322edd270d5d4a9319c9c73ef50e391f9",
"head_commit_message": "doctest",
"patch_to_review": "diff --git a/dask/bag/core.py b/dask/bag/core.py\nindex 502f19e53a5..170fb5a0b9c 100644\n--- a/dask/bag/core.py\n+++ b/dask/bag/core.py\n@@ -675,9 +675,9 @@ def random_sample(self, prob, random_state... | [
{
"diff_hunk": "@@ -2540,19 +2542,37 @@ def random_state_data_python(n, random_state=None):\n Number of tuples to return.\n random_state : int or ``random.Random``, optional\n If an int, is used to seed a new ``random.Random``.\n- \"\"\"\n- if not isinstance(random_state, Random):\n- ... | 4d05b8aa2232db3b9ef10fe79804a980eb0d448b | diff --git a/dask/bag/core.py b/dask/bag/core.py
index 502f19e53a5..f2c7b2e2ac7 100644
--- a/dask/bag/core.py
+++ b/dask/bag/core.py
@@ -673,11 +673,11 @@ def random_sample(self, prob, random_state=None):
Examples
--------
>>> import dask.bag as db
- >>> b = db.from_sequence(range(5))
... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "Performance Optimizations"
} |
cython__cython-4433@b2ae444 | cython/cython | Python | 4,433 | Don't error when exception_check is set to True when return type is PyObject. | This PR fixes issues in pure python mode when Python object is
annotated as returned value - e.g.:
```python
@cython.cfunc
def foo(s) -> str:
```
It raises following exception: `Exception clause not allowed for function returning Python object`.
This exception is raised because Pure python mode defaults `exception_chec... | 2021-10-29T20:10:07Z | (@cython.cfunc + Type Annotation) Fragility
Going through some of pandas' cython modules to try to make code valid-python where possible, I'm seeing cythonize-time errors. It seems like some combinations are invalid for surprising reasons, e.g:
```
cpdef object get_rule_month(object source, object default='DEC')
... | Thanks for that list (and for trying it in the first place). It means we clearly lack tests here, and it's good to have real-world feedback about where people encounter real-world problems.
Regarding the "obvious" cases:
> `def inline func()`
This can never work, because `def` requires Python syntax. Similarly... | [
{
"body": "Going through some of pandas' cython modules to try to make code valid-python where possible, I'm seeing cythonize-time errors. It seems like some combinations are invalid for surprising reasons, e.g:\r\n\r\n```\r\ncpdef object get_rule_month(object source, object default='DEC')\r\n# existing, works... | c69992aa4eb0f7b4529f776820d20b8c66486972 | {
"head_commit": "b2ae444a4f964d8f74a772fd0c3b754b291af87f",
"head_commit_message": "Don't error when exception_check is set to True when return type is PyObject.\n\nCython language is ignoring exception_check when python object is\nreturned. On the other hand this error occurs problems in pure python\nmode when Py... | [
{
"diff_hunk": "@@ -715,7 +715,8 @@ def analyse(self, return_type, env, nonempty=0, directive_locals=None, visibilit\n if (return_type.is_pyobject\n and (self.exception_value or self.exception_check)\n and self.exception_check != '+'):\n- error(self.pos, \"Exce... | cafb50636fad78f63ad9665db7361a3bace18762 | diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py
index aa05a26b884..0bfb0f0046e 100644
--- a/Cython/Compiler/Nodes.py
+++ b/Cython/Compiler/Nodes.py
@@ -712,6 +712,12 @@ def analyse(self, return_type, env, nonempty=0, directive_locals=None, visibilit
env.add_include_file('new') # fo... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Code Refactoring / Architectural Improvement"
} |
dask__dask-10211@5c9eb04 | dask/dask | Python | 10,211 | Fix `clone` + `from_array` failure | - Closes #9621 | 2023-04-22T17:40:51Z | Error when computing a cloned graph from xarray.open_dataset
**Describe the issue**:
After opening a data array from xarray and cloning the underlying dask array, I receive a `TypeError: string indices must be integers` when running `compute()`.
**Minimal Complete Verifiable Example**:
```python
import dask.g... | Thanks for the reproducer. I see this locally with the more recent versions:
```
dask.__version__='2022.10.0'
np.__version__='1.23.4'
xr.__version__='2022.10.0'
```
<details><summary>Full trace back:</summary><pre>
2022-11-03 10:54:08,483 - distributed.worker - WARNING - Compute Failed
Key: ('open_dat... | [
{
"body": "**Describe the issue**:\r\n\r\nAfter opening a data array from xarray and cloning the underlying dask array, I receive a `TypeError: string indices must be integers` when running `compute()`.\r\n\r\n**Minimal Complete Verifiable Example**:\r\n\r\n```python\r\nimport dask.graph_manipulation\r\nimport ... | e9845aadc7c32078e55354b61f5626ac759e8b28 | {
"head_commit": "5c9eb04d5d28718200f1acf5218c80fd863ff977",
"head_commit_message": "Better fix for #8978",
"patch_to_review": "diff --git a/dask/array/blockwise.py b/dask/array/blockwise.py\nindex af09540062e..bb023116b2a 100644\n--- a/dask/array/blockwise.py\n+++ b/dask/array/blockwise.py\n@@ -38,7 +38,8 @@ def... | [
{
"diff_hunk": "@@ -617,7 +617,15 @@ def clone(\n \n indices = []\n for k, idxv in self.indices:\n- if idxv is not None and k in names:\n+ try:\n+ in_names = k in names\n+ except TypeError:\n+ # blockwise() where one or more args are... | 941ac7bd5d5bbd9078a98e6420c629f715b5baa9 | diff --git a/dask/array/blockwise.py b/dask/array/blockwise.py
index af09540062e..bb023116b2a 100644
--- a/dask/array/blockwise.py
+++ b/dask/array/blockwise.py
@@ -38,7 +38,8 @@ def blockwise(
out_ind : iterable
Block pattern of the output, something like 'ijk' or (1, 2, 3)
*args : sequence of Array... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
cython__cython-4552@4a2e6df | cython/cython | Python | 4,552 | Fix failing relative imports in __init__ files. | Fixes #3442 | 2022-01-02T21:06:48Z | `from . cimport modulename` tries to search in parent package from `__init__.pxd`.
In `__init__.pxd` in a package, using `from . cimport modulename` attempts to find `modulename.pxd` in the parent directory of the package.
Using `from . import modulename` in basic Python attempts to find `modulename.*` within the pa... | Thanks for the report. There's probably just a tiny wrong decision taken somewhere, e.g. that `__init__.pxd` is not always considered to be a package in all places or so.
You tried this with the latest master, right? Could you provide a PR that adds this setup to the existing `tests/run/relative_cimport.srctree` tes... | [
{
"body": "In `__init__.pxd` in a package, using `from . cimport modulename` attempts to find `modulename.pxd` in the parent directory of the package.\r\n\r\nUsing `from . import modulename` in basic Python attempts to find `modulename.*` within the package itself, as does using `from . cimport modulename` in a... | 6006a7e8ad4be5f9fcd269b472ee955a3ef931a4 | {
"head_commit": "4a2e6df31167b08faac38317cd5766fb130131cb",
"head_commit_message": "Fix relative imports in __init__ files by searching __init__ file of ModuleScope",
"patch_to_review": "diff --git a/Cython/Compiler/Symtab.py b/Cython/Compiler/Symtab.py\nindex 9a3172aaffc..3b39ec2b8b3 100644\n--- a/Cython/Compil... | [
{
"diff_hunk": "@@ -1362,7 +1374,7 @@ def find_module(self, module_name, pos, relative_level=-1):\n # explicit relative cimport\n # error of going beyond top-level is handled in cimport node\n relative_to = self\n- while relative_level > 0 and relative_to:\n+ ... | 7ca3682a1f4fb1b0262317081c006e935e69abb1 | diff --git a/Cython/Compiler/CythonScope.py b/Cython/Compiler/CythonScope.py
index 08f3da9eb5a..f73be007086 100644
--- a/Cython/Compiler/CythonScope.py
+++ b/Cython/Compiler/CythonScope.py
@@ -51,7 +51,7 @@ def lookup(self, name):
def find_module(self, module_name, pos):
error("cython.%s is not available"... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
deepset-ai__haystack-7401@7c3c59b | deepset-ai/haystack | Python | 7,401 | feat: Add new LLMEvaluator component | ### Related Issues
- fixes #7023
### Proposed Changes:
- Add a new component LLMEvaluator that is limited to the OpenAI api for now and evaluates inputs based on provided instructions and examples
### How did you test it?
- New unit tests
- I used an [example](https://github.com/deepset-ai/haystack/blob/... | 2024-03-21T16:54:37Z | LLM Eval - Implement custom LLM evaluator component in core
Implement a `LLMEvaluator` component with the following parameters:
- `api` - API to use (openai, cohere, etc)
- `api_key` - API secret
- `inputs` - tuple of expected inputs
- Will act as the sockets for the component
- `outputs` - keys to look up in ... | [
{
"body": "Implement a `LLMEvaluator` component with the following parameters:\r\n- `api` - API to use (openai, cohere, etc)\r\n- `api_key` - API secret\r\n- `inputs` - tuple of expected inputs\r\n - Will act as the sockets for the component\r\n- `outputs` - keys to look up in the output JSON\r\n- `instructi... | 42b587ab55eca80d8a3cc6b62c47193d9e5e9ac4 | {
"head_commit": "7c3c59b322b70ba9c7ac949c632d1be1c3fddb16",
"head_commit_message": "make outputs parameter optional. default:",
"patch_to_review": "diff --git a/haystack/components/evaluators/__init__.py b/haystack/components/evaluators/__init__.py\nindex 9550a5f42d..88e78e5756 100644\n--- a/haystack/components/... | [
{
"diff_hunk": "@@ -0,0 +1,230 @@\n+import json\n+from typing import Any, Dict, List, Optional, Tuple, Type\n+\n+from haystack import component, default_from_dict, default_to_dict\n+from haystack.components.builders import PromptBuilder\n+from haystack.components.generators import OpenAIGenerator\n+from haystac... | bf9ba0ca8910ce26a9a1afad44d81bf011d5a503 | diff --git a/haystack/components/evaluators/__init__.py b/haystack/components/evaluators/__init__.py
index 9550a5f42d..88e78e5756 100644
--- a/haystack/components/evaluators/__init__.py
+++ b/haystack/components/evaluators/__init__.py
@@ -1,3 +1,4 @@
from .answer_exact_match import AnswerExactMatchEvaluator
+from .llm... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "New Feature Additions"
} | |
dask__dask-10170@fc6225f | dask/dask | Python | 10,170 | Support arrow dtypes in `Index` meta creation | - [x] Closes #10160
- [x] Tests added / passed
- [x] Passes `pre-commit run --all-files`
Sits on top of #10169
Not sure if there is a better way, this supports all dtypes that we support in pandas as of right now.
I let some of the cases fall through to the regular index check (pa.bool and pa.string), hence we... | 2023-04-11T10:17:39Z | `ddf.set_index('col')` fails with pyarrow timestamp dtype column
**Describe the issue**:
The `set_index` operation fails on dask dataframes when the column dtype is a pyarrow timestamp.
**Minimal Complete Verifiable Example**:
```python
import pandas as pd
import pyarrow as pa
import dask.dataframe as dd
t... | A related example, although happy to move into another issue if appropriate. Seems to be tied to meta generation when the index is a pyarrow timestamp dtype
```python
index = pd.Series(
data=[pd.Timestamp('2022-01-01')],
dtype=pd.ArrowDtype(pa.timestamp('ns')),
)
str_series = pd.Series(['a'], index=inde... | [
{
"body": "**Describe the issue**:\r\nThe `set_index` operation fails on dask dataframes when the column dtype is a pyarrow timestamp.\r\n\r\n**Minimal Complete Verifiable Example**:\r\n\r\n```python\r\nimport pandas as pd\r\nimport pyarrow as pa\r\nimport dask.dataframe as dd\r\n\r\nts_series = pd.Series([pd.T... | 793a0ea0ec1ef0502f0fc5a0d2e38d24cfad05a5 | {
"head_commit": "fc6225f14f9119219c95a26593ed2a2ca2d36d5f",
"head_commit_message": "Fix compatibility",
"patch_to_review": "diff --git a/dask/dataframe/_compat.py b/dask/dataframe/_compat.py\nindex 03ab63d5b46..dd014b7ca59 100644\n--- a/dask/dataframe/_compat.py\n+++ b/dask/dataframe/_compat.py\n@@ -181,3 +181,9... | [
{
"diff_hunk": "@@ -1,9 +1,14 @@\n+from datetime import date, time\n+\n import numpy as np\n import pandas as pd\n import pytest\n+from _decimal import Decimal",
"line": null,
"original_line": 6,
"original_start_line": null,
"path": "dask/dataframe/tests/test_pyarrow.py",
"start_line": null,... | 45d2ee931987b6a83df2ff6b0284600eff51de03 | diff --git a/dask/dataframe/_dtypes.py b/dask/dataframe/_dtypes.py
index 709f87965e4..ae05dd9bba7 100644
--- a/dask/dataframe/_dtypes.py
+++ b/dask/dataframe/_dtypes.py
@@ -1,3 +1,6 @@
+from datetime import date, time
+from decimal import Decimal
+
import pandas as pd
from dask.dataframe._compat import PANDAS_GT_15... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "Bug Fixes"
} |
cython__cython-4358@3e775d9 | cython/cython | Python | 4,358 | Support cpp_locals and std::move on prange temps | Fixes #4354 | 2021-09-01T18:50:34Z | [BUG] cpp_locals generates broken code for thread local temp variables
**Describe the bug**
When using cpp_locals(True) in combination with exception handling inside of a prange, an incorrect assignment is generated. The following code:
```cython
cimport cython
from cython.parallel import prange
cdef extern fro... | I'd obviously missed that pranges have their own type of temp. I also wonder if the assignment to parallel_temp should use `std::move` too (although that would need a close look at the context it's used in)
> I also wonder if the assignment to parallel_temp should use std::move too (although that would need a close loo... | [
{
"body": "**Describe the bug**\r\nWhen using cpp_locals(True) in combination with exception handling inside of a prange, an incorrect assignment is generated. The following code:\r\n```cython\r\ncimport cython\r\nfrom cython.parallel import prange\r\n\r\ncdef extern from *:\r\n \"\"\"\r\n class Test {\r... | ba6eba21e82e34a14bdae4996fd0b9b297c40f72 | {
"head_commit": "3e775d9c95350b05443acc9d7b258856ceac34fa",
"head_commit_message": "Support cpp_locals and std::move on prange temps\n\nFixes #4354",
"patch_to_review": "diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py\nindex 4b0da59cf46..47d9864ab3f 100644\n--- a/Cython/Compiler/Nodes.py\n+++ b/... | [
{
"diff_hunk": "@@ -96,3 +101,10 @@ cdef class AssignToClassAttr:\n def test_generator_cpp_iterator_as_temp():\n for i in get_NoAssign_Py():\n yield i\n+\n+from cython.parallel cimport prange\n+\n+def test_in_prange():\n+ cdef int i\n+ for i in prange(10, nogil=True):\n+ var = get_NoAss... | 119b4580cd4e89ba65a651ef6a1857fa9acd8957 | diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py
index 4b0da59cf46..47d9864ab3f 100644
--- a/Cython/Compiler/Nodes.py
+++ b/Cython/Compiler/Nodes.py
@@ -9237,7 +9237,10 @@ def save_parallel_vars(self, code):
if not lastprivate or entry.type.is_pyobject:
continue
- ... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "Bug Fixes"
} |
deepset-ai__haystack-7289@61ef16b | deepset-ai/haystack | Python | 7,289 | fix: Remove pipeline serialization from telemetry code | ### Related Issues
- fixes #7255
~~probably also fixing #7277 we need to double check ~~
- fixes #7277
### Proposed Changes:
Instead of using pipeline serialization to get all components, we now loop through the nodes in the pipeline graph.
### How did you test it?
<!-- unit tests, integration tests, ... | 2024-03-01T17:51:49Z | ValueError is raised by telemetry code in `component.to_dict()` if a TokenSecret is used
A ValueError is raised by telemetry code in `component.to_dict()` if a TokenSecret is used in any component of a pipeline.
In telemetry code, we currently serialize the whole pipeline to then loop through the components and add ... | Hey @Asma-droid...
Try with "torch.bfloat16" (quotes included).
hello @anakin87 . I still have the same problem
Please provide more information.
Which specific beta version are you using?
How did you generate such serialized pipeline?
How are you deserializing that pipeline?
With this information, tomorrow I w... | [
{
"body": "A ValueError is raised by telemetry code in `component.to_dict()` if a TokenSecret is used in any component of a pipeline.\r\n\r\nIn telemetry code, we currently serialize the whole pipeline to then loop through the components and add their name and any additional telemetry data to a telemetry event.... | 72d776c39068b2c437596f6c98681ab160ef900f | {
"head_commit": "61ef16bfffee0b056263ca32bb2d130c2bd8693f",
"head_commit_message": "add test for pipeline.walk() with cycles",
"patch_to_review": "diff --git a/haystack/core/pipeline/pipeline.py b/haystack/core/pipeline/pipeline.py\nindex 0d70b5be0b..7a713daf40 100644\n--- a/haystack/core/pipeline/pipeline.py\n+... | [
{
"diff_hunk": "@@ -144,18 +145,17 @@ def pipeline_running(pipeline: \"Pipeline\") -> Optional[Tuple[str, Dict[str, Any]\n pipeline._last_telemetry_sent = datetime.datetime.now()\n \n # Collect info about components\n- pipeline_description = pipeline.to_dict()\n components: Dict[str, List[Dict[st... | bcc527ab151559be42383b606e23967460fdf595 | diff --git a/haystack/core/pipeline/pipeline.py b/haystack/core/pipeline/pipeline.py
index 0d70b5be0b..2a05710005 100644
--- a/haystack/core/pipeline/pipeline.py
+++ b/haystack/core/pipeline/pipeline.py
@@ -7,7 +7,7 @@
from copy import copy, deepcopy
from datetime import datetime
from pathlib import Path
-from typin... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
deepset-ai__haystack-7314@def7b35 | deepset-ai/haystack | Python | 7,314 | docs: Prepare the readme for 2.0.0 | ### Related Issues
- fixes #7285
### Proposed Changes:
👉 [Preview](https://github.com/deepset-ai/haystack/blob/massi/readme/README.md)
### Notes for the reviewer
The change is a bit radical but here's the philosophy behind:
- We offer high-quality content through the documentation, the Haystack websit... | 2024-03-06T09:54:52Z | Revamp Haystack README.md
The README should be completely redesigned, but the scope of this task is limited to:
- make prominent the getting started text and code snippets, plus a
- remove occurrences of the Beta mentions
- more in general, make it fully compliant to 2.0.0 | [
{
"body": "The README should be completely redesigned, but the scope of this task is limited to:\n- make prominent the getting started text and code snippets, plus a\n- remove occurrences of the Beta mentions\n- more in general, make it fully compliant to 2.0.0",
"number": 7285,
"title": "Revamp Haystac... | c3caadb2340d569b9a72b519df65be49249592e9 | {
"head_commit": "def7b35c120cf32af30275050bb5e0d872ee4657",
"head_commit_message": "downgrade to IMPORTANT",
"patch_to_review": "diff --git a/README.md b/README.md\nindex 6955c8eaa1..d1a99ffa95 100644\n--- a/README.md\n+++ b/README.md\n@@ -9,136 +9,78 @@\n | Meta | [](https://discord.gg/haystack) [](https://twitter.com/haystack_ai) ... | a486ea74f7257742621c1315884772b36df3186c | diff --git a/README.md b/README.md
index 6955c8eaa1..e6e1401e8c 100644
--- a/README.md
+++ b/README.md
@@ -9,136 +9,78 @@
| Meta | [](https://discord.gg/haystack) [](https://... | {
"difficulty": "low",
"estimated_review_effort": 1,
"problem_domain": "Documentation Updates"
} | |
dask__dask-10157@732a54b | dask/dask | Python | 10,157 | Fix rechunking behavior for dimensions with known and unknown chunk sizes | Fixes rechunking for dimensions with known and unknown chunk sizes if the dimension is not touched; raises a useful error otherwise.
- [x] Closes #10028
- [x] Tests added / passed
- [x] Passes `pre-commit run --all-files`
| 2023-04-06T18:20:10Z | Rechunking array with known and unknown chunk sizes fails with `KeyError`
```python
import dask.array as da
import dask.dataframe as dd
x = da.ones(shape=(4, 4), chunks=(2, 2))
y = dd.from_array(da.ones(shape=(4, 4), chunks=(2, 2))).values
z = da.concatenate([x, y])
result = z.rechunk(((2, 2, np.nan, np.nan), (4)... | [
{
"body": "```python\r\nimport dask.array as da\r\nimport dask.dataframe as dd\r\nx = da.ones(shape=(4, 4), chunks=(2, 2))\r\ny = dd.from_array(da.ones(shape=(4, 4), chunks=(2, 2))).values\r\nz = da.concatenate([x, y])\r\nresult = z.rechunk(((2, 2, np.nan, np.nan), (4)))\r\nresult.compute()\r\n```\r\nfails with... | b86786e3e1bd5be37a24d5b9743c6c043b9daffc | {
"head_commit": "732a54b9b36827f38d98331bddfd4e7443c3cb72",
"head_commit_message": "Allow rechunking if not touching dimension with missing values",
"patch_to_review": "diff --git a/dask/array/rechunk.py b/dask/array/rechunk.py\nindex 7f06df06c7f..399946826a3 100644\n--- a/dask/array/rechunk.py\n+++ b/dask/array... | [
{
"diff_hunk": "@@ -157,7 +157,7 @@ def _intersect_1d(breaks):\n def _old_to_new(old_chunks, new_chunks):",
"line": null,
"original_line": 157,
"original_start_line": null,
"path": "dask/array/rechunk.py",
"start_line": null,
"text": "@user1:\nnit: if this is used elsewhere, I suggest to... | f76ae4868ba3fd01c50e39ef209366e67963a14c | diff --git a/dask/array/rechunk.py b/dask/array/rechunk.py
index 7f06df06c7f..7b93ba459e2 100644
--- a/dask/array/rechunk.py
+++ b/dask/array/rechunk.py
@@ -10,7 +10,7 @@
import heapq
import math
from functools import reduce
-from itertools import chain, count, product
+from itertools import chain, compress, count, ... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} | |
cython__cython-4129@42d6cd2 | cython/cython | Python | 4,129 | [RFC] Enable overloaded extern static methods (GH #1851) | Closes #1851
Not sure if the approach I'm taking here is the best, but I tracked the issue down to overloads not being properly accounted for in `AttributeNode.analyse_as_type_attribute`. | 2021-04-18T21:36:05Z | Multiple static functions, with same name and different parameters in a class will only expose one
Example:
c++:
```c++
class SqBufferIoStream : public SqIoStream {
public:
static std::shared_ptr<SqBufferIoStream> Open(const std::string& data);
static std::shared_ptr<SqBufferIoStream> Open();
};
```
cy... | [
{
"body": "Example:\r\n\r\nc++:\r\n```c++\r\nclass SqBufferIoStream : public SqIoStream {\r\npublic:\r\n\tstatic std::shared_ptr<SqBufferIoStream> Open(const std::string& data);\r\n\tstatic std::shared_ptr<SqBufferIoStream> Open();\r\n};\r\n```\r\n\r\n\r\ncython:\r\n```python\r\ncdef extern from \"SqBufferIoStr... | 3048be77631d91ddf9210c34f8de436ab70d7c04 | {
"head_commit": "42d6cd266f09f7ab1c26283ce4290b51aba0ac72",
"head_commit_message": "Remove cpp11 tag",
"patch_to_review": "diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py\nindex 2714d3e4d7a..b3e1e10d5e0 100644\n--- a/Cython/Compiler/ExprNodes.py\n+++ b/Cython/Compiler/ExprNodes.py\n@@ -7... | [
{
"diff_hunk": "@@ -7012,29 +7012,11 @@ def analyse_as_type_attribute(self, env):\n return None\n ubcm_entry = entry\n else:\n- # Create a temporary entry describing the C method\n- # as an ordi... | acd858fb4795094e393844e8032a8a5f9cbeed11 | diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py
index 2714d3e4d7a..43e6073c602 100644
--- a/Cython/Compiler/ExprNodes.py
+++ b/Cython/Compiler/ExprNodes.py
@@ -7012,29 +7012,11 @@ def analyse_as_type_attribute(self, env):
return None
ubcm_en... | {
"difficulty": "high",
"estimated_review_effort": 4,
"problem_domain": "Bug Fixes"
} | |
cython__cython-4127@9304a84 | cython/cython | Python | 4,127 | Execute AlignFunctionDefinitions before MarkClosureTransform. | This PR is fixing crashing cython when generator expressions are
used in cdef functions in pure python mode. Fixes #3477.
| 2021-04-17T21:48:42Z | variable 'referenced before assignment' warning, error in all() with .pxd but not .pyx
The following is a standalone example of a problem I've run into trying to accelerate some code:
given allExt.py (takes a set of words and checks if 3rd letter in each is a vowel):
```
class a3v(object):
def __init__(self, ... | Thanks for the report. There seems to be something wrong with the nested generator expressions here and the way the type information is applied from the decorator (or maybe _when_ it is applied).
You didn't mention which Cython version you were using, so I guess it's a recent release. Could you try the latest master... | [
{
"body": "The following is a standalone example of a problem I've run into trying to accelerate some code:\r\n\r\ngiven allExt.py (takes a set of words and checks if 3rd letter in each is a vowel):\r\n```\r\nclass a3v(object):\r\n def __init__(self, inset):\r\n self.myStrSet = inset # set input wor... | 30f5ad30542c63156e4babcab1e783ef44b09e15 | {
"head_commit": "9304a8451bfbe88a83b8f7df9249eb3801029b7c",
"head_commit_message": "Inherit AutoCpdefFunctionDefinitions from AlignFunctionDefinitions",
"patch_to_review": "diff --git a/Cython/Compiler/ParseTreeTransforms.py b/Cython/Compiler/ParseTreeTransforms.py\nindex 33020884068..eeb7f774001 100644\n--- a/C... | [
{
"diff_hunk": "@@ -2535,16 +2533,32 @@ def visit_DefNode(self, node):\n error(pxd_def.pos, \"previous declaration here\")\n return None\n node = node.as_cfunction(pxd_def)\n+ return node\n+\n+ def visit_ExprNode(self, node):\n+ # ignore lambdas a... | 268d60718356078e837a0f28745f57ee521755de | diff --git a/Cython/Compiler/ParseTreeTransforms.py b/Cython/Compiler/ParseTreeTransforms.py
index 33020884068..802508768f5 100644
--- a/Cython/Compiler/ParseTreeTransforms.py
+++ b/Cython/Compiler/ParseTreeTransforms.py
@@ -2496,8 +2496,6 @@ class AlignFunctionDefinitions(CythonTransform):
def visit_ModuleNode(... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "Bug Fixes"
} |
cupy__cupy-5659@44d00ec | cupy/cupy | Python | 5,659 | Eliminate random test ids | `pytest -n 2 tests` looks OK with pytest-xdist 2.3.0
Let's close #5623, while the parameters are still randomly generated in the test collection.
Depends #5599 because
- the new option `_ids=False` is implemented only for pytest-backend `cupy.testing.parameterize`; and
- the test collection should be fast to be... | 2021-08-18T09:54:22Z | Avoid using random in test parameterization value
Currently, the following tests are using random values in test parameterization. I'd like to remove use of random values so that we can use pytest-xdist to run tests in parallel.
```
tests/cupy_tests/core_tests/test_ndarray_adv_indexing.py
tests/cupy_tests/core_tes... | [
{
"body": "Currently, the following tests are using random values in test parameterization. I'd like to remove use of random values so that we can use pytest-xdist to run tests in parallel.\r\n\r\n```\r\ntests/cupy_tests/core_tests/test_ndarray_adv_indexing.py\r\ntests/cupy_tests/core_tests/test_ndarray_scatter... | c770100246daf21f6e3a3bd853083f8c833b2377 | {
"head_commit": "44d00ec9f4f0f7ba85392c10c0ff80e3dce989ba",
"head_commit_message": "Fix unpredictive test ids",
"patch_to_review": "diff --git a/.pfnci/config.pbtxt b/.pfnci/config.pbtxt\nindex 703c81da6dd..5289f7093a6 100644\n--- a/.pfnci/config.pbtxt\n+++ b/.pfnci/config.pbtxt\n@@ -43,7 +43,7 @@ configs {\n ... | [
{
"diff_hunk": "@@ -27,3 +30,37 @@ def pytest_configure(config):\n if _is_in_ci() and _is_pip_installed():\n print(\"***** Installed packages *****\", flush=True)\n subprocess.check_call([sys.executable, '-m', 'pip', 'freeze', '--all'])\n+ if config.pluginmanager.hasplugin(\"xdist\"):\n+ ... | 9ecbabf0fac8b264b1c1c0d37efef385810c9281 | diff --git a/.pfnci/config.pbtxt b/.pfnci/config.pbtxt
index 703c81da6dd..5289f7093a6 100644
--- a/.pfnci/config.pbtxt
+++ b/.pfnci/config.pbtxt
@@ -43,7 +43,7 @@ configs {
value {
requirement {
cpu: 8
- memory: 36
+ memory: 50
disk: 10
gpu: 2
}
@@ -61,7 +61,7 @@ configs {
... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Test Suite / CI Enhancements"
} |
Subsets and Splits
Review Test Instances
Retrieves basic metadata about code review instances but doesn't provide any analytical insights or patterns beyond raw data access.