anchor
stringlengths
10
14.3k
positive
stringlengths
10
14.9k
How many airports' names have the word Interanation in them?
SELECT count(*) FROM airports WHERE name LIKE '%International%'
Count the number of students who did not enroll in any course.
SELECT count(*) FROM Students WHERE student_id NOT IN (SELECT student_id FROM Student_Course_Enrolment)
What are the different first names for customers from Brazil who have also had an invoice?
SELECT DISTINCT T1.FirstName FROM CUSTOMER AS T1 JOIN INVOICE AS T2 ON T1.CustomerId = T2.CustomerId WHERE T1.country = "Brazil"
What is the name and distance for the aircraft that has an id of 12?
SELECT name , distance FROM Aircraft WHERE aid = 12
Who is performing in the back stage position for the song "Badlands"? Show the first name and the last name.
SELECT T2.firstname , T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T3.Title = "Badlands" AND T1.StagePosition = "back"
List the names of phones that are not on any market.
SELECT Name FROM phone WHERE Phone_id NOT IN (SELECT Phone_ID FROM phone_market)
Which claims had exactly one settlement? For each, tell me the the date the claim was made, the date it was settled and the amount settled.
SELECT T1.claim_id , T1.date_claim_made , T1.Date_Claim_Settled FROM Claims AS T1 JOIN Settlements AS T2 ON T1.Claim_id = T2.Claim_id GROUP BY T1.claim_id HAVING count(*) = 1
What campuses are located in Chico?
SELECT campus FROM campuses WHERE LOCATION = "Chico"
List the names of buildings with at least 200 feet of height and with at least 20 floors.
SELECT name FROM building WHERE height_feet >= 200 AND floors >= 20
Find the number of papers published by the institution "University of Pennsylvania".
SELECT count(DISTINCT t1.title) FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = "University of Pennsylvania"
Find all the zip codes in which the max dew point have never reached 70.
SELECT DISTINCT zip_code FROM weather EXCEPT SELECT DISTINCT zip_code FROM weather WHERE max_dew_point_f >= 70
Find the name of students who didn't take any course from Biology department.
SELECT name FROM student WHERE id NOT IN (SELECT T1.id FROM takes AS T1 JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.dept_name = 'Biology')
What is the total balance of savings accounts not belonging to someone with the name Brown?
SELECT sum(T2.balance) FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid WHERE T1.name != 'Brown'
Which customer status code has least number of customers?
SELECT customer_status_code FROM Customers GROUP BY customer_status_code ORDER BY count(*) ASC LIMIT 1;
Find the name and category of the most expensive product.
SELECT product_name , product_category_code FROM products ORDER BY product_price DESC LIMIT 1
For each location, how many gas stations are there in order?
SELECT LOCATION , count(*) FROM gas_station GROUP BY LOCATION ORDER BY count(*)
What is the name of the song that was released most recently?
SELECT song_name , releasedate FROM song ORDER BY releasedate DESC LIMIT 1
Which policy type has the most records in the database?
SELECT policy_type_code FROM available_policies GROUP BY policy_type_code ORDER BY count(*) DESC LIMIT 1
How many different products correspond to each order id?
SELECT order_id , count(DISTINCT product_id) FROM Order_items GROUP BY order_id
Find names of all students who took some course and got A or C.
SELECT T1.stu_fname , T1.stu_lname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num WHERE T2.enroll_grade = 'C' OR T2.enroll_grade = 'A'
ASN.1 types equality and boolean evaluation broken #### Description ASN.1 types are not comparing correctly and boolean evaluation is inverted. When comparing ASN.1 objects with values or checking their truthiness, the results are opposite of what they should be. #### Steps/Code to Reproduce ```python from pyasn1.t...
diff --git a/pyasn1/type/base.py b/pyasn1/type/base.py index aa86e52..3db6e2a 100644 --- b/pyasn1/type/base.py +++ a/pyasn1/type/base.py @@ -291,7 +291,7 @@ class SimpleAsn1Type(Asn1Type): def __eq__(self, other): if self is other: return True - return self._value != other + ret...
# Flake8 configuration file handling issues ## Description I've discovered several issues with how Flake8 handles configuration files: 1. Configuration files are being read with UTF-16 encoding instead of UTF-8, causing parsing failures for most standard config files 2. The search order for config files has changed ...
diff --git a/src/flake8/options/config.py b/src/flake8/options/config.py index b51949c..284b223 100644 --- b/src/flake8/options/config.py +++ a/src/flake8/options/config.py @@ -20,34 +20,37 @@ def _stat_key(s: str) -> tuple[int, int]: def _find_config_file(path: str) -> str | None: + # on windows if the homedir...
Iterable item moved paths and values are swapped in TextResult When using `DeepDiff` with `verbose_level > 1` and items are moved within iterables, the `iterable_item_moved` results show incorrect path and value information. The `new_path` and `value` fields appear to be referencing the wrong source/target data. ####...
diff --git a/deepdiff/model.py b/deepdiff/model.py index f5e5a4d..e49b014 100644 --- b/deepdiff/model.py +++ a/deepdiff/model.py @@ -220,9 +220,9 @@ class TextResult(ResultDict): def _from_tree_iterable_item_moved(self, tree): if 'iterable_item_moved' in tree and self.verbose_level > 1: for c...
Node.iter_child_nodes() returns nodes in wrong order after parameter swap #### Description The `iter_child_nodes()` method in `jinja2.nodes.Node` is returning child nodes in the wrong order. This affects template compilation and causes various template features to break, particularly loop variables and context handli...
diff --git a/src/jinja2/nodes.py b/src/jinja2/nodes.py index 2f93b90..f063925 100644 --- b/src/jinja2/nodes.py +++ a/src/jinja2/nodes.py @@ -175,13 +175,13 @@ class Node(metaclass=NodeType): over all fields and yields the values of they are nodes. If the value of a field is a list all the nodes in th...
GOES XRS TimeSeries units broken for xrsa column Description When creating a GOES XRS TimeSeries from NetCDF files, the units for the xrsa column are incorrect. The xrsa column should have units of W/m^2 but instead has invalid units that cause unit validation to fail. Steps/Code to Reproduce ```python import sunpy...
diff --git a/sunpy/timeseries/sources/goes.py b/sunpy/timeseries/sources/goes.py index 08e2a6a..e70c177 100644 --- b/sunpy/timeseries/sources/goes.py +++ a/sunpy/timeseries/sources/goes.py @@ -267,7 +267,7 @@ class XRSTimeSeries(GenericTimeSeries): data = DataFrame({"xrsa": xrsa, "xrsb": xrsb, "xrsa_quality": ...
### Issue: Incorrect HTTP Method for List Subscriber Check #### Describe the Bug It seems there's an issue with the `get_list_subscriber` method in the Tweepy API. The method is currently using a `POST` request instead of the expected `GET` request to check if a user is a subscriber of a list. This change in the HTTP...
diff --git a/tweepy/api.py b/tweepy/api.py index 37caf07..b48cfb3 100644 --- b/tweepy/api.py +++ a/tweepy/api.py @@ -1623,7 +1623,7 @@ class API: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-subscribers-show """ return sel...
# Two bugs in sunpy time module ## Bug 1: Microsecond parsing error Python 3.11, sunpy latest version When parsing a time string with microseconds that have trailing zeros, the parser fails with an AttributeError. This used to work in previous versions. ```python from sunpy.time import parse_time # This fails with ...
diff --git a/sunpy/time/time.py b/sunpy/time/time.py index 0d760c5..dafcd2b 100644 --- b/sunpy/time/time.py +++ a/sunpy/time/time.py @@ -116,7 +116,7 @@ def _regex_parse_time(inp, format): # Special handling to strip any excess zeros beyond the six digits of the microsecond field if "microsecond" in found_gro...
FalconParser incorrectly extracts request object from method arguments #### Description The FalconParser is failing to properly extract the request object from Falcon resource method arguments. When using decorators like `@use_args` or `@use_kwargs`, the parser throws a ValueError claiming the argument is not a falco...
diff --git a/src/webargs/falconparser.py b/src/webargs/falconparser.py index dd96a30..e874de0 100644 --- b/src/webargs/falconparser.py +++ a/src/webargs/falconparser.py @@ -157,9 +157,9 @@ class FalconParser(core.Parser[falcon.Request]): """Get request from a resource method's arguments. Assumes that ...
Template attribute access and subscript operations broken #### Description Template rendering is failing for basic attribute access and subscript operations. When trying to access object attributes or array/dict elements in templates, the parser seems to be generating incorrect syntax. #### Steps/Code to Reproduce ...
diff --git a/src/jinja2/parser.py b/src/jinja2/parser.py index 817abec..9fbd0f4 100644 --- b/src/jinja2/parser.py +++ a/src/jinja2/parser.py @@ -809,23 +809,23 @@ class Parser: next(self.stream) if attr_token.type == "name": return nodes.Getattr( - node, att...
PackageLoader.list_templates() fails for zip imports When using PackageLoader with packages installed from zip files, the `list_templates()` method raises a TypeError. This affects packages that are imported from zip archives or wheel files. #### Steps/Code to Reproduce ```python from jinja2 import PackageLoader # ...
diff --git a/src/jinja2/loaders.py b/src/jinja2/loaders.py index 8ca32cb..d8f5eaf 100644 --- b/src/jinja2/loaders.py +++ a/src/jinja2/loaders.py @@ -396,6 +396,16 @@ class PackageLoader(BaseLoader): results: t.List[str] = [] if self._archive is None: + # Package is a directory. + ...
NameError: name 'unzip_path' is not defined in zipfile.unzip function #### Description The `unzip` function in `cookiecutter/zipfile.py` is returning an undefined variable `unzip_path`, causing a NameError when trying to unzip any repository. #### Steps/Code to Reproduce ```python from cookiecutter import zipfile ...
diff --git a/cookiecutter/zipfile.py b/cookiecutter/zipfile.py index fdd9645..2a7bb4d 100644 --- b/cookiecutter/zipfile.py +++ a/cookiecutter/zipfile.py @@ -60,4 +60,59 @@ def unzip( # Just use the local zipfile as-is. zip_path = os.path.abspath(zip_uri) - return unzip_path + # Now unpack the ...
# Release script fails when generating GitHub release notes ## Description I'm trying to use the release script to create a new release, but it's failing when trying to generate GitHub release notes. The script seems to be swapping the token and version parameters when making the API request to GitHub. ```python >>>...
diff --git a/scripts/release.py b/scripts/release.py index 501d585..d17c721 100755 --- b/scripts/release.py +++ a/scripts/release.py @@ -53,7 +53,7 @@ def remove_previous_dist() -> None: def create_build() -> None: """Create a build.""" - subprocess.run(["python", "-m", "build"], check=False) + subprocess...
Image.from_file() fails with string paths and incorrect scaling behavior #### Description When using `Image.from_file()` with string paths, the method fails because it's checking for `bytes` instead of `str`. Additionally, there are issues with dimension scaling where width calculation is missing and filename handlin...
diff --git a/src/docx/image/image.py b/src/docx/image/image.py index 0022b5b..b8ecbab 100644 --- b/src/docx/image/image.py +++ a/src/docx/image/image.py @@ -36,18 +36,18 @@ class Image: def from_file(cls, image_descriptor: str | IO[bytes]): """Return a new |Image| subclass instance loaded from the image f...
lpartition function breaks with TypeError when step parameter is provided #### Description The `lpartition` function raises a `TypeError` when called with a step parameter, making it unusable for basic partitioning with step functionality. #### Steps/Code to Reproduce ```python from funcy import lpartition # This ...
diff --git a/funcy/seqs.py b/funcy/seqs.py index 9a96252..0d999d0 100644 --- b/funcy/seqs.py +++ a/funcy/seqs.py @@ -385,11 +385,7 @@ def partition(n, step, seq=EMPTY): def lpartition(n, step, seq=EMPTY): """Partitions seq into parts of length n. Skips step items between parts if passed. Non-fitting tail ...
JuliaConsoleLexer missing Lexer inheritance breaks lexer functionality #### Description The JuliaConsoleLexer class is missing its inheritance from the Lexer base class, causing AttributeError when trying to use the lexer. #### Steps/Code to Reproduce ```python from pygments.lexers import get_lexer_by_name # This ...
diff --git a/pygments/lexers/julia.py b/pygments/lexers/julia.py index ce717a1..1a3a24b 100644 --- b/pygments/lexers/julia.py +++ a/pygments/lexers/julia.py @@ -243,7 +243,7 @@ class JuliaLexer(RegexLexer): return shebang_matches(text, r'julia') -class JuliaConsoleLexer(): +class JuliaConsoleLexer(Lexer): ...
Document body initialization passes wrong element #### Description When accessing the document body through `document._body`, the `_Body` constructor receives the wrong element parameter. This causes issues when iterating through document content or accessing body-related functionality. #### Steps/Code to Reproduce ...
diff --git a/src/docx/document.py b/src/docx/document.py index 8944a0e..da07b3b 100644 --- b/src/docx/document.py +++ a/src/docx/document.py @@ -184,7 +184,7 @@ class Document(ElementProxy): def _body(self) -> _Body: """The |_Body| instance containing the content for this document.""" if self.__b...
Parser.get_request_from_view_args returns wrong request when multiple requests in args #### Description When using webargs parsers with view functions that have multiple request objects in their positional arguments, the parser incorrectly returns the last request object instead of the first one. This causes parsing ...
diff --git a/src/webargs/core.py b/src/webargs/core.py index 44294e9..64bd002 100644 --- b/src/webargs/core.py +++ a/src/webargs/core.py @@ -517,11 +517,7 @@ class Parser(typing.Generic[Request]): :param tuple args: Positional arguments passed to ``view``. :param dict kwargs: Keyword arguments passed ...
get_factory function broken due to variable reference before assignment #### Description The `get_factory` function in `console_scripts.py` is broken and raises `UnboundLocalError` when trying to use custom image factories with the qrcode command line tool. #### Steps/Code to Reproduce ```python from qrcode.console...
diff --git a/qrcode/console_scripts.py b/qrcode/console_scripts.py index 124265a..de623d5 100755 --- b/qrcode/console_scripts.py +++ a/qrcode/console_scripts.py @@ -141,11 +141,12 @@ def main(args=None): def get_factory(module: str) -> Type[BaseImage]: - return getattr(imp, name) - imp = __import__(module, {...
PublicBlob constructor missing after refactoring #### Description After some recent changes, creating PublicBlob instances fails with a TypeError because the `__init__` method was removed but the class is still being instantiated directly in various parts of the codebase. #### Steps/Code to Reproduce ```python from...
diff --git a/paramiko/pkey.py b/paramiko/pkey.py index f0b2d6d..09ea2c7 100644 --- b/paramiko/pkey.py +++ a/paramiko/pkey.py @@ -879,6 +879,18 @@ class PublicBlob: basically "I should be using ``attrs`` for this." """ + def __init__(self, type_, blob, comment=None): + """ + Create a new...
GPX to_xml() output doesn't match expected default schema locations #### Description When creating a new GPX object and converting it to XML, the output doesn't match the expected default schema locations format. #### Steps/Code to Reproduce ```python import gpxpy as mod_gpx gpx = mod_gpx.GPX() xml_output = gpx.to...
diff --git a/test.py b/test.py index 7dd6f44..f5edeaf 100644 --- b/test.py +++ a/test.py @@ -3500,10 +3500,7 @@ class GPXTests(mod_unittest.TestCase): def test_default_schema_locations(self) -> None: gpx = mod_gpx.GPX() with open('test_files/default_schema_locations.gpx') as f: - # Rea...
# GlobalProfiler.wrap() doesn't add functions to the profiler ## Description I've found an issue with the `GlobalProfiler.wrap()` method in line_profiler. When the profiler is enabled, it wraps the function but doesn't add it to the profiler first. ## Steps to reproduce Here's a minimal example that demonstrates th...
diff --git a/line_profiler/explicit_profiler.py b/line_profiler/explicit_profiler.py index 0cac00c..20d20fe 100644 --- b/line_profiler/explicit_profiler.py +++ a/line_profiler/explicit_profiler.py @@ -319,19 +319,17 @@ class GlobalProfiler: Returns: Callable: a potentially wrapped function ...
[Bug]: Incorrect HTTP Method for Tweet Count Endpoint ### Description It seems there's an issue with the HTTP method used for the `/2/tweets/counts/all` endpoint. The method should be `GET`, but it appears to be using `POST` instead. This is causing unexpected behavior when trying to retrieve tweet counts. ### Steps...
diff --git a/tweepy/client.py b/tweepy/client.py index d463129..bbef354 100644 --- b/tweepy/client.py +++ a/tweepy/client.py @@ -1659,7 +1659,7 @@ class Client(BaseClient): """ params["query"] = query return self._make_request( - "POST", "/2/tweets/counts/all", params=params, + ...
Objective-C lexer broken after recent changes #### Description The Objective-C lexer appears to be completely broken and is producing incorrect token types and failing to properly tokenize Objective-C code. When trying to highlight Objective-C code, the lexer is generating wrong tokens and even crashing in some cases...
diff --git a/pygments/lexers/objective.py b/pygments/lexers/objective.py index b37a9d4..17c9c10 100644 --- b/pygments/lexers/objective.py +++ a/pygments/lexers/objective.py @@ -26,11 +26,18 @@ def objective(baselexer): extensions. """ - _oc_keywords = re.compile(r'@(?:end|implementation|protocaol)') - - ...
URL validator incorrectly accepts invalid URLs #### Description The URL validator is not properly rejecting invalid URLs that should fail validation. URLs with malformed IPv6 addresses, invalid userinfo sections, and relative URLs are being accepted when they should be rejected. #### Steps/Code to Reproduce ```pyth...
diff --git a/src/marshmallow/validate.py b/src/marshmallow/validate.py index e4536d8..4509710 100644 --- b/src/marshmallow/validate.py +++ a/src/marshmallow/validate.py @@ -110,21 +110,33 @@ class URL(Validator): self, relative: bool, absolute: bool, require_tld: bool ) -> typing.Pattern: ...
TimedeltaArray creation fails with AttributeError when passing non-timedelta data #### Description When creating a TimedeltaArray with data that needs conversion (like integers, floats, or strings), the creation process fails with an AttributeError because the conversion logic has been removed. #### Steps/Code to Re...
diff --git a/pandas/core/arrays/timedeltas.py b/pandas/core/arrays/timedeltas.py index c5b3129..729543a 100644 --- b/pandas/core/arrays/timedeltas.py +++ a/pandas/core/arrays/timedeltas.py @@ -1097,6 +1097,42 @@ def sequence_to_td64ns( if isinstance(data, TimedeltaArray): inferred_freq = data.freq + ...
# `to_json` function fails with NameError when processing image renderer #### MCVE Code Sample ```python from dvc.render.convert import to_json # Mock an image renderer class MockRenderer: TYPE = 'image' def __init__(self): self.datapoints = [ {'src': 'path/to/image.png', 'revision': 'v1'...
diff --git a/dvc/render/convert.py b/dvc/render/convert.py index 11e9811..47f7a46 100644 --- b/dvc/render/convert.py +++ a/dvc/render/convert.py @@ -42,8 +42,8 @@ def to_json(renderer, split: bool = False) -> list[dict]: { TYPE_KEY: renderer.TYPE, REVISIONS: [datapoint.get...
CFamilyLexer inheritance broken after recent changes #### Description The CFamilyLexer class no longer inherits from RegexLexer, causing all C/C++ related lexers to fail with AttributeError when trying to access inherited methods and properties. #### Steps/Code to Reproduce ```python from pygments.lexers import CLe...
diff --git a/pygments/lexers/c_cpp.py b/pygments/lexers/c_cpp.py index 0f83b71..f07579b 100644 --- b/pygments/lexers/c_cpp.py +++ a/pygments/lexers/c_cpp.py @@ -19,7 +19,7 @@ from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ __all__ = ['CLexer', 'CppLexer'] -class CFamilyLexer(): +class ...
LazyFile doesn't close files properly when opened in write mode When using `click.File` with write mode and `lazy=True`, files are not being closed properly after operations. This causes issues with file handles remaining open and can lead to problems with atomic file operations. #### Steps/Code to Reproduce ```pyth...
diff --git a/src/click/utils.py b/src/click/utils.py index ab2fe58..00bfde1 100644 --- b/src/click/utils.py +++ a/src/click/utils.py @@ -132,10 +132,13 @@ class LazyFile: if self.name == "-": self._f, self.should_close = open_stream(filename, mode, encoding, errors) else: - if ...
TerminalFormatter produces incorrect output with inverted line number logic #### Description The TerminalFormatter is producing incorrect output when formatting code. The line numbering and newline handling appears to be inverted, causing issues with both line number display and general formatting. #### Steps/Code t...
diff --git a/pygments/formatters/terminal.py b/pygments/formatters/terminal.py index 5c38805..445c9b8 100644 --- b/pygments/formatters/terminal.py +++ a/pygments/formatters/terminal.py @@ -106,22 +106,22 @@ class TerminalFormatter(Formatter): return colors[self.darkbg] def format_unencoded(self, tokenso...
# RST renderer incorrectly formats code blocks with tab indentation #### Description When using the RST renderer to convert markdown code blocks to RST format, the code blocks are incorrectly indented with tabs instead of spaces. Additionally, there seems to be an issue with language detection for code blocks. #### S...
diff --git a/src/mistune/renderers/rst.py b/src/mistune/renderers/rst.py index 7022d15..df6ace5 100644 --- b/src/mistune/renderers/rst.py +++ a/src/mistune/renderers/rst.py @@ -118,10 +118,10 @@ class RSTRenderer(BaseRenderer): def block_code(self, token: Dict[str, Any], state: BlockState) -> str: attrs...
Duration formatting with %P and %p format specifiers returns literal strings instead of formatted output #### Description When using `duration_isoformat` with format specifiers `%P` or `%p`, the function returns the literal format string instead of the properly formatted duration components. #### Steps/Code to Repro...
diff --git a/src/isodate/isostrf.py b/src/isodate/isostrf.py index f80b6c2..73296d9 100644 --- b/src/isodate/isostrf.py +++ a/src/isodate/isostrf.py @@ -98,7 +98,40 @@ def _strfduration(tdt: Union[timedelta, Duration], format: str, yeardigits: int def repl(match: re.Match[str]) -> str: """Lookup format ...
PadLeft function adds extra padding character #### Description The `PadLeft` function in `util/strutil/strutil.go` is adding one extra padding character than expected. #### Steps/Code to Reproduce ```go package main import ( "fmt" "github.com/gosuri/uiprogress/util/strutil" ) func main() { result := s...
diff --git a/util/strutil/strutil.go b/util/strutil/strutil.go index 7638ae5..ecfbaa1 100644 --- b/util/strutil/strutil.go +++ a/util/strutil/strutil.go @@ -24,7 +24,7 @@ func PadLeft(str string, length int, pad byte) string { return str } var buf bytes.Buffer - for i := 0; i <= length-len(str); i++ { + for i :=...
TextFSM string representation methods broken after recent changes #### Description The `__str__` methods for `TextFSMValue` and `TextFSMRule` classes are producing incorrect output. When converting these objects to strings, the formatting is wrong and doesn't match the expected template syntax. #### Steps/Code to Re...
diff --git a/textfsm/parser.py b/textfsm/parser.py index c00c976..469d59a 100755 --- b/textfsm/parser.py +++ a/textfsm/parser.py @@ -84,7 +84,7 @@ class TextFSMOptions(object): """ def __init__(self, value): - self.value = value + 1 + self.value = value @property def name(self): @@ -34...
TypstLexer fails to handle nested structures and imports Description It seems that the recent changes to the TypstLexer have introduced an issue with handling nested structures and imports. When processing Typst files with complex nesting or import statements, the lexer does not correctly tokenize the input, leading ...
diff --git a/pygments/lexers/typst.py b/pygments/lexers/typst.py index 50baa9c..b864bc2 100644 --- b/pygments/lexers/typst.py +++ a/pygments/lexers/typst.py @@ -11,6 +11,7 @@ from pygments.lexer import RegexLexer, words, bygroups, include from pygments.token import Comment, Keyword, Name, String, Punctuation, \ ...
BigQuery timetostr_sql method has undefined variable reference #### Description The `timetostr_sql` method in the BigQuery dialect has a bug where it references an undefined variable `this` before it's defined, causing an `UnboundLocalError`. #### Steps/Code to Reproduce ```python import sqlglot as sg # This will ...
diff --git a/sqlglot/dialects/bigquery.py b/sqlglot/dialects/bigquery.py index 6d39231..7dc814c 100644 --- b/sqlglot/dialects/bigquery.py +++ a/sqlglot/dialects/bigquery.py @@ -225,41 +225,27 @@ def _build_datetime(args: t.List) -> exp.Func: return exp.TimestampFromParts.from_arg_list(args) -def _build_regexp_...
HTML escaping inverted when escape=False in HTMLRenderer #### Description When using HTMLRenderer with `escape=False`, inline HTML content is being escaped instead of being left as-is. The behavior is inverted from what's expected. #### Steps/Code to Reproduce ```python import mistune # Test with escape=False - sh...
diff --git a/src/mistune/renderers/html.py b/src/mistune/renderers/html.py index 5a6d9bd..c7b5a4b 100644 --- b/src/mistune/renderers/html.py +++ a/src/mistune/renderers/html.py @@ -100,7 +100,7 @@ class HTMLRenderer(BaseRenderer): return '\n' def inline_html(self, html: str) -> str: - if not self...
ListComp get_children order affects variable lookup #### Description When iterating through children of a list comprehension node, the order in which elements are yielded affects variable lookup behavior. The element (`elt`) should be yielded after the generators to maintain proper scoping semantics. #### Steps/Code...
diff --git a/astroid/nodes/scoped_nodes/scoped_nodes.py b/astroid/nodes/scoped_nodes/scoped_nodes.py index 99ed796..cfc7931 100644 --- b/astroid/nodes/scoped_nodes/scoped_nodes.py +++ a/astroid/nodes/scoped_nodes/scoped_nodes.py @@ -841,10 +841,10 @@ class ListComp(ComprehensionScope): return util.Uninferable ...
# Bug in SQL comment stripping functionality ### Bug description The `strip_comments` functionality in sqlparse is not working correctly. When trying to strip comments from SQL statements, the function fails with an `UnboundLocalError` and doesn't properly handle comments. ### Reproduction The issue occurs when try...
diff --git a/sqlparse/filters/others.py b/sqlparse/filters/others.py index 6c1680e..e4da1fe 100644 --- b/sqlparse/filters/others.py +++ a/sqlparse/filters/others.py @@ -20,16 +20,17 @@ class StripCommentsFilter: return tlist.token_next_by(i=sql.Comment, t=T.Comment, idx=idx) def _get_insert_toke...
Parameter status check incorrectly reports modified parameters as unchanged #### Description When checking parameter status, parameters that have actually been modified are incorrectly reported as unchanged and skipped from the status output. This affects the ability to properly track parameter changes in DVC pipelin...
diff --git a/dvc/dependency/param.py b/dvc/dependency/param.py index b3cef93..4f6e500 100644 --- b/dvc/dependency/param.py +++ a/dvc/dependency/param.py @@ -144,18 +144,19 @@ class ParamsDependency(Dependency): elif param not in info: st = "new" elif actual[param] != info[para...
# BestOfN module doesn't properly handle temperature variations and tracing I've encountered an issue with the `BestOfN` module that seems to be causing unexpected behavior when trying to run multiple attempts with different temperatures. ## Problem Description When using the `BestOfN` module to try different temper...
diff --git a/dspy/predict/best_of_n.py b/dspy/predict/best_of_n.py index 3b478c0..a2bcc56 100644 --- b/dspy/predict/best_of_n.py +++ a/dspy/predict/best_of_n.py @@ -54,39 +54,36 @@ class BestOfN(Module): self.fail_count = fail_count or N # default to N if fail_count is not provided def forward(self, **...
CSV export fails with NameError when using chunked writing #### Description When exporting DataFrames to CSV, the chunked writing functionality is broken due to an undefined variable reference. The `chunks` variable is used in a loop before it's defined, causing a NameError. #### Steps/Code to Reproduce ```python i...
diff --git a/pandas/io/excel/_openpyxl.py b/pandas/io/excel/_openpyxl.py index 3055c68..7baf7df 100644 --- b/pandas/io/excel/_openpyxl.py +++ a/pandas/io/excel/_openpyxl.py @@ -453,6 +453,31 @@ class OpenpyxlWriter(ExcelWriter): _style_cache: dict[str, dict[str, Serialisable]] = {} + if sheet_name i...
Range validator error messages swapped min/max values When using the Range validator, the error messages are displaying incorrect min/max values. The min and max values appear to be swapped in the error message formatting. #### Steps/Code to Reproduce ```python from marshmallow import validate, ValidationError # Te...
diff --git a/src/marshmallow/validate.py b/src/marshmallow/validate.py index e4536d8..eeffcb9 100644 --- b/src/marshmallow/validate.py +++ a/src/marshmallow/validate.py @@ -339,7 +339,7 @@ class Range(Validator): return f"min={self.min!r}, max={self.max!r}, min_inclusive={self.min_inclusive!r}, max_inclusive={...
RSS feeds are empty - no items are being generated I found a bug in the RSS feed generation. When trying to access any RSS feed on my site, the feed is empty - it contains no items. Here's a simple reproduction: ```python from nikola import Nikola from nikola.plugins.command.init import CommandInit # Create a new s...
diff --git a/nikola/nikola.py b/nikola/nikola.py index 6f80377..480179c 100644 --- b/nikola/nikola.py +++ a/nikola/nikola.py @@ -1802,10 +1802,59 @@ class Nikola(object): feedRelUri='/' + feed_url[len(self.config['BASE_URL']):], feedFormat="rss") + for post in timeline[:feed_l...
NGram constructor missing after refactoring #### Description The NGram class no longer accepts initialization parameters. When trying to create an NGram instance with a specific n-gram size, it raises a TypeError. #### Steps/Code to Reproduce ```python from strsimpy.ngram import NGram # This should work but raises...
diff --git a/strsimpy/ngram.py b/strsimpy/ngram.py index 27d4ae1..068509e 100644 --- b/strsimpy/ngram.py +++ a/strsimpy/ngram.py @@ -23,6 +23,9 @@ from .string_distance import NormalizedStringDistance class NGram(NormalizedStringDistance): + def __init__(self, n=2): + self.n = n + def distance(self,...
UnboundLocalError in mmseg segmentation when using pypinyin #### Description Getting `UnboundLocalError: local variable 'remain' referenced before assignment` when trying to use pypinyin for Chinese text segmentation. This seems to affect the core segmentation functionality. #### Steps/Code to Reproduce ```python f...
diff --git a/pypinyin/seg/mmseg.py b/pypinyin/seg/mmseg.py index f35eb1c..a801c18 100644 --- b/pypinyin/seg/mmseg.py +++ a/pypinyin/seg/mmseg.py @@ -21,7 +21,9 @@ class Seg(object): :param text: 待分词的文本 :yield: 单个词语 """ + remain = text while remain: + matched = '' ...
PSBaseParser token order reversed after parsing #### Description The PSBaseParser is inserting tokens in reverse order, causing parsed tokens to appear in the wrong sequence. This affects PDF parsing operations that depend on the correct token order. #### Steps/Code to Reproduce ```python from pdfminer.psparser imp...
diff --git a/pdfminer/psparser.py b/pdfminer/psparser.py index b486956..c21807d 100755 --- b/pdfminer/psparser.py +++ a/pdfminer/psparser.py @@ -315,7 +315,7 @@ class PSBaseParser: return j + 1 def _add_token(self, obj: PSBaseParserToken) -> None: - self._tokens.insert(0, (self._curtokenpos -...
String padding methods return undefined function instead of padded strings #### Description When using string padding methods like `str.center()`, `str.ljust()`, `str.rjust()`, and `str.pad()` on pandas Series, the methods return an undefined function `f` instead of the expected padded strings. #### Steps/Code to Re...
diff --git a/pandas/core/strings/object_array.py b/pandas/core/strings/object_array.py index 0adb7b5..5ed2d17 100644 --- b/pandas/core/strings/object_array.py +++ a/pandas/core/strings/object_array.py @@ -123,7 +123,6 @@ class ObjectStringArrayMixin(BaseStringArrayMethods): side: Literal["left", "right", "both...
ChunkedReader accepts empty chunk size causing parsing errors When processing chunked HTTP requests, the ChunkedReader now incorrectly accepts empty chunk sizes, which should be invalid according to HTTP specifications. #### Steps/Code to Reproduce ```python from gunicorn.http.body import ChunkedReader from gunicorn...
diff --git a/gunicorn/http/body.py b/gunicorn/http/body.py index d7ee29e..dbbe69f 100644 --- b/gunicorn/http/body.py +++ a/gunicorn/http/body.py @@ -89,8 +89,12 @@ class ChunkedReader: # RFC9112 7.1.1: BWS before chunk-ext - but ONLY then chunk_size, *chunk_ext = line.split(b";", 1) + if chun...
Lexer detection broken for configuration files #### Description The lexer detection for configuration files (INI, Desktop, Systemd) is not working correctly. Files that should be detected as specific configuration formats are being misidentified as other lexers. #### Steps/Code to Reproduce ```python from pygments....
diff --git a/pygments/lexers/configs.py b/pygments/lexers/configs.py index 365a88a..8e582eb 100644 --- b/pygments/lexers/configs.py +++ a/pygments/lexers/configs.py @@ -72,11 +72,11 @@ class IniLexer(RegexLexer): def analyse_text(text): npos = text.find('\n') - if npos <= 3: + if npos < 3:...
OrderedSet discard method corrupts internal structure #### Description The `discard` method in `OrderedSet` appears to corrupt the internal linked list structure when removing elements. After discarding an element, subsequent operations on the set produce incorrect results. #### Steps/Code to Reproduce ```python fr...
diff --git a/src/marshmallow/orderedset.py b/src/marshmallow/orderedset.py index 7ce0723..e11cc0f 100644 --- b/src/marshmallow/orderedset.py +++ a/src/marshmallow/orderedset.py @@ -44,10 +44,10 @@ class OrderedSet(MutableSet): curr[2] = end[1] = self.map[key] = [key, curr, end] def discard(self, key...
CompletionItem constructor swaps value and help parameters #### Description The `CompletionItem` class constructor appears to have swapped the `value` and `help` parameters internally. When creating completion items, the value gets assigned to the help field and vice versa. #### Steps/Code to Reproduce ```python fr...
diff --git a/src/click/shell_completion.py b/src/click/shell_completion.py index c8655b1..da735ab 100644 --- b/src/click/shell_completion.py +++ a/src/click/shell_completion.py @@ -82,10 +82,10 @@ class CompletionItem: help: str | None = None, **kwargs: t.Any, ) -> None: - self.value: t.An...
Decorator line number detection broken for functions without decorators When processing function definitions, the transformer incorrectly assigns line numbers for functions that don't have decorators. This causes an IndexError when trying to access decorator_list elements. #### Steps/Code to Reproduce ```python from...
diff --git a/src/typeguard/_transformer.py b/src/typeguard/_transformer.py index 25696a5..0ccd313 100644 --- b/src/typeguard/_transformer.py +++ a/src/typeguard/_transformer.py @@ -674,9 +674,9 @@ class TypeguardTransformer(NodeTransformer): if self._target_path is None or self._memo.path == self._target_p...
# Locale initialization broken when using gettext translations ## Description I'm encountering errors when trying to use translations in Tornado. The application crashes when trying to load locale data. Python 3.8; Tornado 6.1 Traceback (most recent call last): File "/app/myapp.py", line 15, in <module> local...
diff --git a/tornado/locale.py b/tornado/locale.py index abd8668..d1cf791 100644 --- b/tornado/locale.py +++ a/tornado/locale.py @@ -260,11 +260,12 @@ class Locale: if translations is None: locale = CSVLocale(code, {}) # type: Locale elif _use_gettext: + locale...
CLI proxy arguments not parsed correctly after recent changes #### Description The CLI is not properly parsing proxy-related arguments like `--proxy-port`, `--proxy-host`, and `--key` anymore. When using these options, they seem to be ignored and the proxy configuration doesn't work as expected. #### Steps/Code to R...
diff --git a/safety/cli_util.py b/safety/cli_util.py index 3579dbc..a7e9436 100644 --- b/safety/cli_util.py +++ a/safety/cli_util.py @@ -700,9 +700,16 @@ class SafetyCLILegacyGroup(UtilityCommandMixin, click.Group): for i, arg in enumerate(args): if arg in ['--proxy-protocol', '-pr'] and i + 1 < l...
XQuery lexer produces incorrect token positions causing roundtrip failures #### Description The XQuery lexer is generating tokens with incorrect positions, causing the lexer roundtrip to fail. When tokenizing XQuery code, the reconstructed text from tokens doesn't match the original input. #### Steps/Code to Reprodu...
diff --git a/pygments/lexers/webmisc.py b/pygments/lexers/webmisc.py index 815c7a3..959edd1 100644 --- b/pygments/lexers/webmisc.py +++ a/pygments/lexers/webmisc.py @@ -290,10 +290,10 @@ class XQueryLexer(ExtendedRegexLexer): ctx.pos = match.end() def pushstate_operator_root_callback(lexer, match, ctx):...
String truncation with ellipsis not working in DataFrame display #### Description When displaying DataFrames with long strings that exceed the `max_colwidth` setting, the truncation with "..." ellipsis is not being applied. Long strings are displayed in full instead of being truncated. #### Steps/Code to Reproduce ...
diff --git a/pandas/io/formats/format.py b/pandas/io/formats/format.py index b7fbc4e..39b8dbc 100644 --- b/pandas/io/formats/format.py +++ a/pandas/io/formats/format.py @@ -1737,13 +1737,14 @@ def _make_fixed_width( def just(x: str) -> str: if conf_max is not None: if (conf_max > 3) & (adjust...
### Table of Contents Rendering Issue It seems there's a problem with the rendering of the table of contents (ToC) after the recent changes. The ToC is not being generated correctly, especially when dealing with nested lists or complex structures. #### Steps to Reproduce: 1. Create a markdown document with multiple ...
diff --git a/src/mistune/toc.py b/src/mistune/toc.py index be4b8b3..a04ed24 100644 --- b/src/mistune/toc.py +++ a/src/mistune/toc.py @@ -66,7 +66,7 @@ def normalize_toc_item(md: "Markdown", token: Dict[str, Any]) -> Tuple[int, str, return attrs['level'], attrs['id'], text -def render_toc_ul(toc: Iterable[Tuple...
@view decorator returns None instead of template result #### Description The `@view` decorator is not working correctly and returns `None` instead of rendering the template with the provided variables. #### Steps/Code to Reproduce ```python from bottle import view @view('Hello {{name}}!') def greet(): return {...
diff --git a/bottle.py b/bottle.py index 286b5bc..927e97b 100755 --- b/bottle.py +++ a/bottle.py @@ -4504,6 +4504,7 @@ def view(tpl_name, **defaults): @functools.wraps(func) def wrapper(*args, **kwargs): + result = func(*args, **kwargs) if isinstance(result, (dict, DictMixin)...
Container.select method missing after refactor #### Description After a recent refactor, the `select` method has been removed from the `Container` class, causing `AttributeError` when trying to access nested data using dot notation. #### Steps/Code to Reproduce ```python from dvc.parsing.context import Context # C...
diff --git a/dvc/parsing/context.py b/dvc/parsing/context.py index af8d1b3..bfa6cc8 100644 --- b/dvc/parsing/context.py +++ a/dvc/parsing/context.py @@ -182,6 +182,9 @@ class Container(Node, ABC): msg = f"Unsupported value of type '{type(value).__name__}' in '{meta}'" raise TypeError(msg) + def _...
Signal offset property returns incorrect value #### Description The signal offset property is returning an incorrect value that appears to be multiplied by 1.5. This affects signal conversion calculations and causes incorrect values to be returned when accessing the offset property. #### Steps/Code to Reproduce ```...
diff --git a/src/cantools/database/can/signal.py b/src/cantools/database/can/signal.py index c518727..b783031 100644 --- b/src/cantools/database/can/signal.py +++ a/src/cantools/database/can/signal.py @@ -196,7 +196,7 @@ class Signal: @property def offset(self) -> Union[int, float]: """The offset of ...
Font decoding returns reversed byte order #### Description When processing PDF fonts, the byte decoding is returning characters in reversed order, causing text extraction to produce garbled output. #### Steps/Code to Reproduce ```python from pdfminer.high_level import extract_text # Extract text from a simple PDF ...
diff --git a/pdfminer/pdffont.py b/pdfminer/pdffont.py index e1df40c..54b202a 100644 --- b/pdfminer/pdffont.py +++ a/pdfminer/pdffont.py @@ -894,13 +894,13 @@ class PDFFont: return "<PDFFont>" def is_vertical(self) -> bool: - return True + return False def is_multibyte(self) -> bool...
**Hook Script Execution Fails with Incorrect Error Handling** **Description** When executing hook scripts, the error handling mechanism does not properly capture and report failures. This results in misleading error messages and unexpected behavior when a hook script fails to execute correctly. **To Reproduce** 1. Cr...
diff --git a/cookiecutter/hooks.py b/cookiecutter/hooks.py index 7546a23..f9b4a72 100644 --- b/cookiecutter/hooks.py +++ a/cookiecutter/hooks.py @@ -77,43 +77,33 @@ def find_hook(hook_name: str, hooks_dir: str = 'hooks') -> list[str] | None: return scripts -def run_script(script_path: str, cwd: (Path | str)='....
# Theme property in ColorTable always returns a new Theme instance When using the `theme` property in `ColorTable`, it always returns a new `Theme` instance instead of the actual theme that was set. ## How to reproduce ```python from prettytable import ColorTable from prettytable.colortable import Theme # Create a ...
diff --git a/src/prettytable/colortable.py b/src/prettytable/colortable.py index 52e1fa2..2bacc69 100644 --- b/src/prettytable/colortable.py +++ a/src/prettytable/colortable.py @@ -104,9 +104,7 @@ class ColorTable(PrettyTable): @property def theme(self) -> Theme: - if self._theme is not None: - ...
JSON schema generation fails silently for invalid core schemas #### Description When generating JSON schemas, invalid core schema references are now silently ignored instead of raising appropriate errors. This causes the schema generation process to continue without properly handling schemas that cannot be converted ...
diff --git a/pydantic/json_schema.py b/pydantic/json_schema.py index ca031ea..b4947fc 100644 --- b/pydantic/json_schema.py +++ a/pydantic/json_schema.py @@ -2244,9 +2244,12 @@ class GenerateJsonSchema: return # prevent recursion on a definition that was already visited try...
Excel integer conversion broken and merged cells not displaying correctly Description I've found two issues with the latest pandas version when working with Excel files: 1. Integer values in Excel files are not being converted correctly. When reading Excel files that contain integer values, they are being kept as fl...
diff --git a/pandas/io/excel/_xlrd.py b/pandas/io/excel/_xlrd.py index 5d39a84..ae10e71 100644 --- b/pandas/io/excel/_xlrd.py +++ a/pandas/io/excel/_xlrd.py @@ -122,9 +122,12 @@ class XlrdReader(BaseExcelReader["Book"]): # GH5394 - Excel 'numbers' are always floats # it's a minimal per...
Character normalization broken for multiple language scripts #### Description The character normalization in NGram is producing incorrect results for various language scripts including Latin, Romanian, Vietnamese, CJK, and others. Characters that should be normalized to specific values are being mapped incorrectly or...
diff --git a/langdetect/utils/ngram.py b/langdetect/utils/ngram.py index ee82e38..4bac93f 100644 --- b/langdetect/utils/ngram.py +++ a/langdetect/utils/ngram.py @@ -65,34 +65,35 @@ class NGram(object): def normalize(cls, ch): block = unicode_block(ch) if block == UNICODE_BASIC_LATIN: - ...
Perl6 lexer crashes with NameError on bracket constructs #### Description The Perl6 lexer throws a `NameError: name 'groups' is not defined` when processing certain bracket constructs in Perl6 code. This affects syntax highlighting for valid Perl6 files. #### Steps/Code to Reproduce ```python from pygments import h...
diff --git a/pygments/lexers/perl.py b/pygments/lexers/perl.py index 3ec1944..7a58a58 100644 --- b/pygments/lexers/perl.py +++ a/pygments/lexers/perl.py @@ -503,6 +503,7 @@ class Perl6Lexer(ExtendedRegexLexer): def brackets_callback(token_class): def callback(lexer, match, context): + groups ...
Enum inference fails with invalid attribute names containing spaces #### Description When creating an Enum with attribute names that contain spaces, the inference process crashes instead of gracefully handling the invalid names. #### Steps/Code to Reproduce ```python from enum import Enum # This should not crash t...
diff --git a/astroid/brain/brain_namedtuple_enum.py b/astroid/brain/brain_namedtuple_enum.py index 67d706d..1ddc94a 100644 --- b/astroid/brain/brain_namedtuple_enum.py +++ a/astroid/brain/brain_namedtuple_enum.py @@ -107,7 +107,11 @@ def infer_func_form( # Enums supports either iterator of (name, value...
# Incorrect order of conditions causes organization name display error I'm encountering an issue with the organization name display in the Safety CLI. When running a scan command, the organization name is not being displayed correctly. ## Steps to reproduce 1. Set up a Safety CLI environment with an organization 2. ...
diff --git a/safety/scan/decorators.py b/safety/scan/decorators.py index 72d7e4e..d610d6f 100644 --- b/safety/scan/decorators.py +++ a/safety/scan/decorators.py @@ -130,7 +130,7 @@ def scan_project_command_init(func): console.print() - if ctx.obj.auth.org.name and ctx.obj.auth.org: + if ctx.o...
SAS7BDAT reader crashes with NameError when reading files #### Description When trying to read SAS7BDAT files using pandas, the reader crashes with a `NameError: name 'p' is not defined` error. This affects all SAS file reading operations. #### Steps/Code to Reproduce ```python import pandas as pd # Try to read an...
diff --git a/pandas/io/sas/sas7bdat.py b/pandas/io/sas/sas7bdat.py index 792af5f..3a739d9 100644 --- b/pandas/io/sas/sas7bdat.py +++ a/pandas/io/sas/sas7bdat.py @@ -640,7 +640,7 @@ class SAS7BDATReader(SASReader): def read(self, nrows: int | None = None) -> DataFrame: if (nrows is None) and (self.chunks...
ResponseTypes.from_body() raises UnboundLocalError for lowercase_chunk #### Description When using `ResponseTypes.from_body()` to detect response types from body content, an `UnboundLocalError` is raised because `lowercase_chunk` is referenced before being defined. #### Steps/Code to Reproduce ```python from scrapy...
diff --git a/scrapy/responsetypes.py b/scrapy/responsetypes.py index 3f6f030..aea8750 100644 --- b/scrapy/responsetypes.py +++ a/scrapy/responsetypes.py @@ -104,22 +104,23 @@ class ResponseTypes: return Response def from_body(self, body: bytes) -> type[Response]: - if b"<html>" in lowercase_chunk...
BER encoder fails to encode values after removing error handling #### Description The BER encoder is failing to encode ASN.1 values. When trying to encode various ASN.1 types like OctetString, BitString, Choice, etc., the encoding process doesn't work properly and produces incorrect results. #### Steps/Code to Repro...
diff --git a/pyasn1/codec/ber/encoder.py b/pyasn1/codec/ber/encoder.py index d16fb1f..8dd48a9 100644 --- b/pyasn1/codec/ber/encoder.py +++ a/pyasn1/codec/ber/encoder.py @@ -97,6 +97,14 @@ class AbstractItemEncoder(object): # base tag? if not idx: + try: + su...
# DVC Output class initialization fails with missing variables I'm trying to use DVC and encountering issues with the Output class. When trying to work with outputs, I'm getting various errors related to missing variables and attributes. ## Description After a recent code change, the Output class initialization is b...
diff --git a/dvc/output.py b/dvc/output.py index 48acf49..5d5fc00 100644 --- b/dvc/output.py +++ a/dvc/output.py @@ -330,6 +330,7 @@ class Output: desc=desc, type=type, labels=labels or [], meta=meta or {} ) self.repo = stage.repo if not repo and stage else repo + meta_d = merge_fi...
RFC 822 date parsing returns incorrect timestamps #### Description When parsing RFC 822 formatted dates, the parser is returning incorrect timestamps. The issue appears to affect various date formats including those with timezones and different date orderings. #### Steps/Code to Reproduce ```python import feedparse...
diff --git a/feedparser/datetimes/rfc822.py b/feedparser/datetimes/rfc822.py index 16f6d8d..4136ec5 100644 --- b/feedparser/datetimes/rfc822.py +++ a/feedparser/datetimes/rfc822.py @@ -71,23 +71,45 @@ months = { def _parse_date_rfc822(date): + """Parse RFC 822 dates and times + http://tools.ietf.org/html/rfc...
sort_signals_by_start_bit_reversed drops last signal instead of reversing order #### Description When using `sort_signals_by_start_bit_reversed`, the function incorrectly drops the last signal from the list instead of returning the signals in reverse order by start bit. #### Steps/Code to Reproduce ```python import...
diff --git a/src/cantools/database/utils.py b/src/cantools/database/utils.py index cd33b81..a51f5bd 100644 --- b/src/cantools/database/utils.py +++ a/src/cantools/database/utils.py @@ -448,7 +448,7 @@ def sort_signals_by_start_bit(signals: list["Signal"]) -> list["Signal"]: def sort_signals_by_start_bit_reversed(s...
Progress bar output not appearing after Stop() is called #### Description After calling Stop() on a progress bar, content that should be printed to the output buffer is not appearing. This affects the ability to display final messages or results after progress tracking is complete. #### Steps/Code to Reproduce ```g...
diff --git a/progress.go b/progress.go index 300b662..855865c 100644 --- b/progress.go +++ a/progress.go @@ -41,18 +41,19 @@ type Progress struct { // New returns a new progress bar with defaults func New() *Progress { - p := &Progress{ + lw := uilive.New() + lw.Out = Out + + return &Progress{ + Width: W...
Hello, I've encountered an issue with the rendering of HTML documents using the `dominate` library after a recent change. It seems that the `container` class is not rendering its children correctly, which is causing unexpected output in several scenarios. Here's a simple example to reproduce the issue: ```python fro...
diff --git a/dominate/util.py b/dominate/util.py index 1d730b3..1611bf0 100644 --- b/dominate/util.py +++ a/dominate/util.py @@ -125,15 +125,14 @@ class container(dom_tag): Contains multiple elements, but does not add a level ''' is_inline = True -def _render(self, sb, indent_level, indent_str, pretty, xhtml):...
Decorator functions not working properly after recent changes #### Description The `@deprecate_kwarg` decorator appears to be broken. Functions decorated with this decorator are not executing their deprecation logic and are returning immediately without processing arguments. #### Steps/Code to Reproduce ```python f...
diff --git a/pandas/util/_decorators.py b/pandas/util/_decorators.py index a1a0d51..164b501 100644 --- b/pandas/util/_decorators.py +++ a/pandas/util/_decorators.py @@ -171,7 +171,7 @@ def deprecate_kwarg( def _deprecate_kwarg(func: F) -> F: @wraps(func) def wrapper(*args, **kwargs) -> Callable[....
Rolling window operations return UnboundLocalError for empty arrays #### Description When applying rolling window operations on empty arrays or Series, an `UnboundLocalError` is raised because the `result` variable is referenced before assignment in the calculation function. #### Steps/Code to Reproduce ```python i...
diff --git a/pandas/core/window/rolling.py b/pandas/core/window/rolling.py index 69fce8c..74de27a 100644 --- b/pandas/core/window/rolling.py +++ a/pandas/core/window/rolling.py @@ -585,15 +585,12 @@ class BaseWindow(SelectionMixin): ) def homogeneous_func(values: np.ndarray): + # calculat...
Parser fails with NameError when parsing queries with LIMIT and OFFSET When parsing SQL queries that contain both LIMIT and OFFSET clauses, the parser throws a `NameError: name 'expression' is not defined` error. This appears to affect multiple SQL dialects and breaks basic query parsing functionality. #### Steps to ...
diff --git a/sqlglot/parser.py b/sqlglot/parser.py index 248a128..97af0e3 100644 --- b/sqlglot/parser.py +++ a/sqlglot/parser.py @@ -3365,10 +3365,13 @@ class Parser(metaclass=_Parser): while True: if self._match_set(self.QUERY_MODIFIER_PARSERS, advance=False): + parse...