WhereIsAI/github-issue-similarity huggingface dataset:
Issue 1:
Kevin Burke opened SPR-7916 and commented

When attempting to inject a bean created via the util:map tag into a service, an error results when the key type of the map is any thing other than java.lang.String. I have specified the key type using the key-type attribute of the tag, but to no avail.

The underlying Map that is required is Map<Integer, String>, but according to the DefaultListableBeanFactory, a hard check of String.isAssignableFrom(keyType) is performed (line 753).

else if (Map.class.isAssignableFrom(type) && type.isInterface()) {
Class keyType = descriptor.getMapKeyType();
if (keyType == null || !String.class.isAssignableFrom(keyType)) {
if (descriptor.isRequired()) {
throw new FatalBeanException("Key type [" + keyType + "] of map [" + type.getName() +
"] must be assignable to [java.lang.String]");

Affects: 3.0.3

Reference URL: http://forum.springsource.org/showthread.php?p=342130#post342130

Issue Links:

#14040 Session not flushed with Hibernate 4.1.3, JTA and Spring transaction management integration ("duplicates")

Issue 2:
Bob Tiernay opened SPR-4492 and commented

The following branch in DefaultListableBeanFactory.resolveDependency requires that a dependency of interface type java.util.Map have java.lang.String as it's key type or it will fail:

...

else if (Map.class.isAssignableFrom(type) && type.isInterface()) {

Class keyType = descriptor.getMapKeyType();

if (keyType == null || !String.class.isAssignableFrom(keyType)) {

if (descriptor.isRequired()) {

throw new FatalBeanException("Key type [" + keyType + "] of map [" + type.getName() +

"] must be assignable to [java.lang.String]");

}

return null;

}

...

This seems overly restrictive and is evinced when using @Autowire. Is there some rationale for this contraint?

Affects: 2.5.1

Issue Links:

#13164 Support injection of collection-typed beans using @Autowired+@Qualifier or @Inject+@Named
Issue 1:
Ran into this error while working on fp-ts:

% cat import-in-comment.ts
function hello(who: string): string {
return `hello ${who}`;
}
/**
* `
* import { scanLeft } from 'some/path/in/comment.ts'
*/

% deno import-in-comment.ts
Compile file:///Users/jaka/Desktop/import-in-comment.ts
error: Uncaught URIError: relative import path "some/path/in/comment.ts" not prefixed with / or ./ or ../ Imported from "file:///Users/jaka/Desktop/import-in-comment.ts"
► $deno$/errors.ts:35:13
at constructError ($deno$/errors.ts:35:13)
at unwrapResponse ($deno$/dispatch_json.ts:41:12)
at sendSync ($deno$/dispatch_json.ts:70:10)
at resolveModules ($deno$/compiler_imports.ts:70:10)
at processImports ($deno$/compiler_imports.ts:172:27)
at processImports ($deno$/compiler_imports.ts:181:13)

Some rogue regexp somewhere?

Issue 2:
v0.20.0

Parser doesn't find declarations correctly?

[EDITED]

Previous example has unrelated mistake but I don' know which code can reproduce error I met.

I met this error when I ran -> https://raw.githubusercontent.com/keroxp/dink/v0.5.1/main.ts

That can be compiled with deno@v0.19.0. But got error below with v0.20.0:

error: Uncaught ImportPrefixMissing: relative import path "${resp.url}" not prefixed with / or ./ or ../
► $deno$/dispatch_json.ts:40:11
at DenoError ($deno$/errors.ts:20:5)
at unwrapResponse ($deno$/dispatch_json.ts:40:11)
at sendAsync ($deno$/dispatch_json.ts:85:10)
Issue 1:
Original ticket http://projects.scipy.org/numpy/ticket/1527 on 2010-06-29 by @sandrotosi, assigned to unknown.

Hello,

I'm here forwarding the bug filed in the Debian BTS at http://bugs.debian.org/564774 .

The bug refers to 1.3.0 but I'm able to replicate it with 1.4.1 too. The key part is (for the rest, please read the link above):

>>> import numpy as np
>>> np.savez('test.npz', N.ones((10000, 1000)))
>>> ll -h *.npz
-rw-r--r-- 1 michael michael 77M 2010-01-11 15:52 test.npz
>>> !gzip test.npz
>>> ll -h test*.gz
-rw-r--r-- 1 michael michael 114K 2010-01-11 15:52 test.npz.gz
^^^^

Thanks for your support,

Sandro

Issue 2:
Original ticket http://projects.scipy.org/numpy/ticket/1354 on 2010-01-09 by @jpaalasm, assigned to unknown.

It would be useful if the compression argument for zipfile.!ZipFile could be specified when creating an npz-file.
Issue 1:
Q
A

Bug report?
no

Feature request?
yes

BC Break report?
no

RFC?
yes/no/dunno

Symfony version
3.2

Routing works like:

wallet_read:
path: /wallet/{id}.{_format}

Would be nice to have that a bit more intelligent like

wallet_read:
path: /wallet/{wallet.id}/{wallet.title}.{_format}

So that URL generator like in Twig receive the entity and does the rest of the magic:

path('wallet_show', {wallet: wallet})

How about that?

Issue 2:
There is currently a known limitation when using route imports that makes it impossible to to have a root route / be imported under a prefix without a trailing slash. See #4322 and silexphp/Silex#149

I propose to solve this problem in a generic way by offering an option when importing routes to remove or add trailing slashes (which defaults to null, meaning not modifying anything):

AcmeBusinessBundle_client:
resource: "@AcmeBusinessBundle/Resources/config/routing/client.yml"
prefix: /clients
trailing_slashes: true|false|null

This way, the users can unify the path on import the way they want.

So for example

acme_business_client_list:
path: /
defaults: { _controller: AcmeBusinessBundle:Client:list }

imported with trailing_slashes: false under prefix: /clients will result in path /clients instead of /clients/.

The other case with trailing_slashes: true is helpful when you import third party routes without trailing slash but you decided that you app should use training slashes everywhere consistently.
Issue 1:
ISSUE TYPE

Bug Report

COMPONENT NAME

run_once

delegate_to

ANSIBLE VERSION

ansible 2.3.0.0
config file = /etc/ansible/ansible.cfg
configured module search path = Default w/o overrides
python version = 2.7.12 (default, Nov 19 2016, 06:48:10) [GCC 5.4.0 20160609]

CONFIGURATION

Nothing notable changed.

OS / ENVIRONMENT

N/A (but using Ubuntu 16.0.4.2 for both)

SUMMARY

I recently updated Ansible to 2.3.0.0 and several tasks that use a run_once: true with delegate_to: 127.0.0.1 are now being skipped. I've included an example below which used to run as long as at least one host was valid (not skipped). Now the play is skipped regardless when run_once: true.

STEPS TO REPRODUCE

Including the task below with one skipped host and one valid host on Ansible 2.3.0.0 results in the task being skipped altogether for me. Changing it to run_once: false allows it to process with first host being skipped and the other triggering it. The issue seems similar to this old (closed) issue -- #9784

"As run_once will always target the first host in the list, if that host is supposed to skip a set of tasks (due to some condition, for instance), it will also skip any run_once tasks even though they may delegate_to other hosts which are willing to run that task."

- name: Clone XXXXXXX locally for v{{ _current_version }}
git:
repo: 'git@somehost.somewhere.com:group/project.git'
dest: '{{ _local_repobase }}/{{ _current_version }}'
depth: 1
update: yes
version: 'v{{ _current_version }}'
run_once: true
delegate_to: 127.0.0.1

EXPECTED RESULTS

Task should run once on the local host

ACTUAL RESULTS

Task is skipped.

Issue 2:
ISSUE TYPE

Bug Report

COMPONENT NAME

core

ANSIBLE VERSION

ansible 2.4.3.0
config file = /etc/ansible/ansible.cfg
configured module search path = [u'/home/selivan/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.7/dist-packages/ansible
executable location = /usr/bin/ansible
python version = 2.7.12 (default, Dec 4 2017, 14:50:18) [GCC 5.4.0 20160609]

CONFIGURATION

ANSIBLE_NOCOWS(/etc/ansible/ansible.cfg) = True

OS / ENVIRONMENT

Ansible host: Ubuntu GNU/Linux 16.04 Xenial

Managed host: Ubuntu GNU/Linux 16.04 Xenial

SUMMARY

Named block statements (http://docs.ansible.com/ansible/latest/playbooks_blocks.html) do not work in handlers. Ansible does not see that handler at all.

STEPS TO REPRODUCE

- hosts: all
become: yes
tasks:
- name: install nginx config
template: src=nginx.conf dest=/etc/nginx/nginx.conf mode=0644
notify: reload nginx
handlers:
- name: reload nginx
block:
- shell: nginx -t
- service: name=nginx state=reloaded

EXPECTED RESULTS

Handler reload nginx should run and execute both modules: first shell, then, if shell returned success, execute service.

ACTUAL RESULTS

ERROR! The requested handler 'reload nginx' was not found in either the main handlers list nor in the listening handlers list
Issue 1:
Your question

Why does the base url not get picked up?

playwirght.config.ts

import { PlaywrightTestConfig } from '@playwright/test';
const config: PlaywrightTestConfig = {
timeout: 30000,
globalTimeout: 600000,
workers: 2,
projects: [
{
name: "chrome",

use: {
headless: false,
baseURL: 'http://dev.getmyboat.com/',
channel: 'chrome',
viewport: { width: 1280, height: 720 },
ignoreHTTPSErrors: false,
video: 'on-first-retry',
screenshot: 'only-on-failure'
}
}
],

reporter: [["dot"], ["json", { outputFile: "test-result.json" }],
['experimental-allure-playwright']],
// globalSetup: require.resolve('./global-setup'),
};
export default config;

test

import { test, Browser, BrowserContext } from "@playwright/test"
import registerPage from '../Pages/registerPage';
import {getOwnerToken, getRenterToken} from "../../utils/authUtils"
declare const browser: Browser

test.describe("Register New User", async () => {
let context: BrowserContext;
test("@smoke1 C613 Validate user is able to Register/Create account", async ({ browser }) => {

context = await browser.newContext({
storageState: "cookies/banner.json"
});
const page = await context.newPage();
await page.goto('/s/auth/register');
const regPage = new registerPage(page);
await regPage.registerUser()
await regPage.clickCreateAccount()
await regPage.clickAccept()
await page.waitForNavigation({
url: 'http://dev.getmyboat.com/'
})

});

test.afterAll(async ({ browser }) => {
await browser.close();
})
test.afterEach(async ({ context }) => {
await context.close();
})

});

results

page.goto: Protocol error (Page.navigate): Cannot navigate to invalid URL
=========================== logs ===========================
navigating to "/s/auth/register", waiting until "load"
============================================================

12 | });
13 | const page = await context.newPage();
> 14 | await page.goto('/s/auth/register');
| ^
15 | const regPage = new registerPage(page);
16 | await regPage.registerUser()
17 | await regPage.clickCreateAccount()

Issue 2:
Playwright version

1.13.0

Operating system

Windows

What browsers are you seeing the problem on?

Chromium

Other information

No response

What happened? / Describe the bug

Trying to get baseURL set up in the playwright config file but it just doesn't seem to find it.

I've just updated to 1.13.0. Here's some snapshots.

Am I doing something wrong here?

Code snippet to reproduce your bug

No response

Relevant log output

No response
Issue 1:
Migrated issue, originally created by Anonymous

SQLAlchemy refuses the following declaration:

ok = Column(Boolean, nullable=False, default=False, server_default=False)

You have to use the following instead, but I'm not sure it's portable (and it's also less natural to type):

ok = Column(Boolean, nullable=False, default=False, server_default="0")

Issue 2:
Migrated issue, originally created by Anonymous

t = Table('test', meta,
Column('abc', Boolean, server_default=False),
)

I should be able to do this, right???

--

Hatem Nassrat
Issue 1:
The problem occurs when pressing the button to print from the browser.

The electron simply locks or ignores the pressure command.

which load is any page like electron.com it prints normal.

but when loading a pdf file and ordering the print it doesn't work.

does this have any solution today?

const win2 = new BrowserWindow({
webPreferences: {
plugins: true
}
})

win2.loadURL(__dirname + '/file.pdf', {})
win2.webContents.once('did-finish-load', async function() {
try {
const pdfData = await win2.webContents.printToPDF({})
const outPath = __dirname +'/snotas.pdf'
fs.writeFile(outPath, pdfData, (error) => {
if (error) throw error
console.log(`Wrote PDF to: ${outPath}`)
})
} catch(e) {
console.error(e)
}

})
})

The code above is only a third of the many I have tried.

Issue 2:
Preflight Checklist

I have read the Contributing Guidelines for this project.

I agree to follow the Code of Conduct that this project adheres to.

I have searched the issue tracker for an issue that matches the one I want to file, without success.

Issue Details

Electron Version:

9.1.0

Operating System:

macOS Mojave 10.14.6

Last Known Working Electron version:

just v9. Because in electron version 9 was introduce "pdf viewer", but now it cant print pdf.

Expected Behavior

just print correctly the pdf...

Actual Behavior

when you try to print with "window.print()" a page that load a PDF electron do not respond.... sometimes crash...

To Reproduce

just clone "electron-quick-start" and replace this line :

mainWindow.loadFile('index.html')

for

mainWindow.loadURL('http://www.africau.edu/images/default/sample.pdf')

and replace all content script "preload.js" for:

window.addEventListener('DOMContentLoaded', () => {

window.print();

});

this is a example repo to reproduce the error:

https://github.com/rgarcia1990/electron-quick-start

just do the normal setup

$ git clone https://github.com/rgarcia1990/electron-quick-start

$ npm install

$ npm start || electron .

and when the app electron start will popup print dialog, just try to print!

that is all!
Issue 1:
Do you want to request a feature or report a bug?

Bug

What is the current behavior?

In Chrome, using event.preventDefault() and/or event.nativeEvent.preventDefault() within onWheel handler of an input[type=number] does not prevent number scrolling.

https://www.chromestatus.com/features/6662647093133312

React example: https://codesandbox.io/s/00kx423nyl

HTML & JS example for comparison: https://jsbin.com/warerunitu/edit?html,js,output

What is the expected behavior?

I would expect the same behaviour as shown in the HTML & JS example above.

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?

Tested in react@16.8.5, react-dom@16.8.5 and Chrome v73. I'm unsure if previous versions are affected.

Issue 2:
Similar to #8968, but for the wheel and mousewheel events. They are now passive by default for root elements in Chrome 73 (currently beta) which means React apps that have custom scrolling/zooming behaviors will run into issues.

The quick fix may be to manually add event listeners with {passive: false} but has the React team considered if this should be configurable for the React event handler?

Blog post from the Chrome team here: https://developers.google.com/web/updates/2019/02/scrolling-intervention
Issue 1:
Migrated issue, originally created by Anonymous

One mysql table can be updated by the results of another table but the

mysql UPDATE statement requires all tables referenced

viz:

UPDATE T1,T2 SET T1.col = T2.col WHERE T1.id = T2.id

and not (as sqla currently does)

UDPDATE T1 SET T1.col = T2.col WHERE T1.id = T2.id

which produces an error

The attached python code uses the excellent sqla compiler to

enhance the Update compiler but the changes are so trivial I think

they should go into dialects/mysql/base.py

Attachments: update.patch | enhance2.py | enhance.py | base.py.patch

Issue 2:
Describe the bug

When calling the visit_on_duplicate_key_update method, the compiled output will replace all the insert_stmt.inserted aliases to the one matching the column.name, even if the alias points to another object.

The issue could be considered a split-off from #5173, at https://github.com/sqlalchemy/sqlalchemy/blob/rel_1_3_24/lib/sqlalchemy/dialects/mysql/base.py#L1436, where it sets "VALUES(" + self.preparer.quote(column.name) + ")".

I think the best way is to use obj.name instead of column.name.

Btw, the issue can be reproduced on both 1.3.24 and 1.4.26.

To Reproduce

from datetime import datetime
from sqlalchemy import Column, Integer, String, Boolean, DateTime, func
from sqlalchemy.ext.declarative import declarative_base

Base = declarative_base()

class DebugTbl(Base):
__tablename__ = 'debug_tbl'

id = Column(Integer, primary_key=True)
name = Column(String)
enabled = Column(Boolean)
updated = Column(DateTime)

entries = [
{
'name': 'first',
'enabled': True,
'updated': datetime.utcnow(),
},
{
'name': 'second',
'enabled': False,
'updated': datetime.utcnow(),
},
]

# check the insert/update against the `debug_tbl` table, with IF statement

insert_stmt = mysql.insert(DebugTbl).values(entries)
on_duplicate_key_stmt = insert_stmt.on_duplicate_key_update(
name=func.IF(insert_stmt.inserted.updated > DebugTbl.updated,
insert_stmt.inserted.name,
DebugTbl.name),
enabled=func.IF(insert_stmt.inserted.updated > DebugTbl.updated,
insert_stmt.inserted.enabled,
DebugTbl.enabled),
updated=func.IF(insert_stmt.inserted.updated > DebugTbl.updated,
insert_stmt.inserted.updated,
DebugTbl.updated),
)
sql_statement = on_duplicate_key_stmt.compile(dialect=mysql.dialect())

assert sql_statement.string == (
'INSERT INTO debug_tbl (name, enabled, updated) '
'VALUES (%s, %s, %s), (%s, %s, %s) '
'ON DUPLICATE KEY UPDATE '
'name = IF(VALUES(updated) > debug_tbl.updated, VALUES(name), debug_tbl.name), '
'enabled = IF(VALUES(updated) > debug_tbl.updated, VALUES(enabled), debug_tbl.enabled), '
'updated = IF(VALUES(updated) > debug_tbl.updated, VALUES(updated), debug_tbl.updated)'
)

Error

AssertionError

Versions

OS: Windows

Python: 3.8.8

SQLAlchemy: 1.3.24

Database: MySQL 5.7.33

DBAPI (eg: psycopg, cx_oracle, mysqlclient): pymysql 0.9.3

Additional context

No response
Issue 1:
Original ticket http://projects.scipy.org/scipy/ticket/862 on 2009-02-01 by @nilswagner01, assigned to unknown.

python2.6 and

>>> scipy.__version__
'0.8.0.dev5530'

scipy.test()

======================================================================
ERROR: Testing that kmeans2 init methods work.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/nwagner/local/lib64/python2.6/site-packages/scipy/cluster/tests/test_vq.py", line 147, in test_kmeans2_init
data = data.reshape((200, 2))
ValueError: total size of new array must be unchanged

======================================================================
ERROR: Testing simple call to kmeans2 with rank 1 data.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/nwagner/local/lib64/python2.6/site-packages/scipy/cluster/tests/test_vq.py", line 127, in test_kmeans2_rank1
data = data.reshape((200, 2))
ValueError: total size of new array must be unchanged

======================================================================
ERROR: Testing simple call to kmeans2 with rank 1 data.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/nwagner/local/lib64/python2.6/site-packages/scipy/cluster/tests/test_vq.py", line 139, in test_kmeans2_rank1_2
data = data.reshape((200, 2))
ValueError: total size of new array must be unchanged

======================================================================
ERROR: This will cause kmean to have a cluster with no points.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/nwagner/local/lib64/python2.6/site-packages/scipy/cluster/tests/test_vq.py", line 96, in test_kmeans_lost_cluster
data = data.reshape((200, 2))
ValueError: total size of new array must be unchanged

Issue 2:
Original ticket http://projects.scipy.org/scipy/ticket/778 on 2008-11-04 by @pv, assigned to unknown.

The following tests in MMIO part of scipy.io and scipy.cluster fail under non-English locale (presumably those in which "," is the decimal separator).

My guess is that the underlying reason for the failures probably is a locale dependency in numpy.fromfile. If so, fixing this requires first fixes in Numpy.

Traceback (most recent call last):
File "/home/pauli/koodi/proj/scipy/scipy.git/dist/linux/lib/python2.5/site-pac
kages/scipy/cluster/tests/test_vq.py", line 141, in test_kmeans2_init
data = data.reshape((200, 2))
ValueError: total size of new array must be unchanged
======================================================================
Traceback (most recent call last):
File "/home/pauli/koodi/proj/scipy/scipy.git/dist/linux/lib/python2.5/site-pac
kages/scipy/cluster/tests/test_vq.py", line 121, in test_kmeans2_rank1
data = data.reshape((200, 2))
ValueError: total size of new array must be unchanged
======================================================================
... etc, see test.log-fi ...

(The Lapack failures in the test log are a separate issue, gh-1304.)
Issue 1:
Hi, I have a lots of unique fields in my database and I want to raise HTTPException with proper detail for each field that is duplicated.

what is the best way to do it?

Issue 2:
First Check

I added a very descriptive title to this issue.

I used the GitHub search to find a similar issue and didn't find it.

I searched the FastAPI documentation, with the integrated search.

I already searched in Google "How to X in FastAPI" and didn't find any information.

I already read and followed all the tutorial in the docs and didn't find an answer.

I already checked if it is not related to FastAPI but to Pydantic.

I already checked if it is not related to FastAPI but to Swagger UI.

I already checked if it is not related to FastAPI but to ReDoc.

Commit to Help

I commit to help with one of those options 👆

Example Code

from fastapi import FastAPI, Header, Depends

app = FastAPI()

async def some_header(some_header: str = Header(...)) -> str:
return some_header

async def some_dependency_one(test_header: str = Depends(some_header)) -> str:
return test_header + "one"

async def some_dependency_two(test_header: str = Depends(some_header)) -> str:
return test_header + "two"

@app.get("/")
async def root(
some_dependency_one: str = Depends(some_dependency_one),
some_dependency_two: str = Depends(some_dependency_two)
):
return {"1": some_dependency_one, "2": some_dependency_two}

Description

Curl the root path without the header "some_header":

curl -X 'GET' \
> 'http://127.0.0.1:8000/' \
> -H 'accept: application/json' \
>

{
"detail": [{
"loc": ["header", "some-header"],
"msg": "field required",
"type": "value_error.missing"
}, {
"loc": ["header", "some-header"],
"msg": "field required",
"type": "value_error.missing"
}]
}

The missing header error is duplicated twice.

Is this expected?

I believe that, even if it is currently expected, as FastAPI is caching sub-dependencies according to https://fastapi.tiangolo.com/tutorial/dependencies/sub-dependencies/#using-the-same-dependency-multiple-times

it should be possible to "de-duplicate" errors like this. So we could turn this "question" or "bug" report into a feature request :)

Operating System

macOS

Operating System Details

No response

FastAPI Version

0.68.2

Python Version

3.9.6

Additional Context

No response