Incorrect TypeCode encode when the message body is nil

When the body message is nil the client should encode TypeCodeNull value.
Let's go more in-depth :)!
The behaviour between .NET amqpnetlite and this codec differs.

amqpnetlite
Given a message with the null body with the amqpnetlite :
Message nullEmptyMessage = new Message(null);
var buff =nullEmptyMessage.Encode();

[0] = {byte} 0
[1] = {byte} 83 // TypeCodeSmallUlong
[2] = {byte} 119 // TypeCodeAMQPValue
[3] = {byte} 64 // TypeCodeNull

✅  This behaviour is correct.

go-amqp
nilGolangMessage := amqp.NewMessage(nil)
binary, _ := nilGolangMessage.MarshalBinary()

[0] = {byte} 0
1 = {uint8} 83  // TypeCodeSmallUlong
2 = {uint8} 117 // TypeCodeApplicationData
3 = {uint8} 160 // TypeCodeVbin8
4 = {uint8} 0

❌ That, I think, is a sort of bug when the body is nil; the client should encode TypeCodeNull

💡 Possible Fix
It works with this possible fix https://github.com/Gsantomaggio/go-amqp/blob/null_value/message.go#L124-L133
nilGolangMessage := amqp.NewMessageWithValue(nil)
binary, _ := nilGolangMessage.MarshalBinary()

0 = {uint8} 0
1 = {uint8} 83 // TypeCodeSmallUlong
2 = {uint8} 119 // TypeCodeAMQPValue
3 = {uint8} 64 // TypeCodeNull

oasis documentation
The problem statement is summarised as follows:
"The client should be able to send a body consisting of a single amqp-value section (https://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-messaging-v1.0-os.html#type-amqp-value) which in turn consists of the AMQP null value (https://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-types-v1.0-os.html#type-null)"

Thank you

We use this in our RabbitMQ AMQP 1.0 client, here.
Thank you

Thanks for the detailed bug report, it really helps. I haven't had a chance to dig into this too much yet but was wondering if the current behavior is causing issues/incorrect behavior?

but was wondering if the current behavior is causing issues/incorrect behavior?

Yes, unfortunately :)
Let me explain:
In RabbitMQ, we released native support for AMQP 1.0
There is an implementation REST-like for dealing with resource creation, such as queues, exchanges, and bindings.
To delete a resource, we send a message with a NULL (TypeCodeNull) value.  See here
The  other clients  send TypeCodeSmallUlong, TypeCodeAMQPValue, TypeCodeNull  in case of null/nil message , so it works correctly:

✅ Java AMQP 1.0  that uses QPID-proton as base client.
✅ NET AMQP 1.0 that uses amqpnetlite as base client.

The Go AMQP 1.0 Client currently uses this client as a base client, and It is not possible to send TypeCodeAMQPValue with a TypeCodeNull value ❌.
That's why I temporarily did this fix here: https://github.com/Gsantomaggio/go-amqp/blob/null_value/message.go#L124-L133.  Please let me know if it makes sense to PR it. Any suggestion is welcome :)
Thank you


Cypress Error: Step implementation missing for: I open mortgage calculator page

I'm currently trying to implement cypress e2e tests for a basic mortgage calculator using bdd style. My feature file location is  cypress/integration/mortgage.feature and my step file is at cypress/integration/mortgage/mortgage.js Would appreciate if anyone could help.
Editor - VS Code
I'm getting this error "error: Step implementation missing for:" whenever I run the tests.
Please find below error logs. I will appreciate if anyone could help.
Error

Step implementation missing for: I open basic mortgage calculator page

View stack trace
Error: Step implementation missing for: I open basic mortgage calculator page
• at Context.resolveAndRunStepDefinition (https://react-redux.realworld.io/__cypress/tests?p=cypress/integration/mortgage.feature-207:24485:11)
• at Context. (https://react-redux.realworld.io/__cypress/tests?p=cypress/integration/mortgage.feature-207:23851:35)
• From previous event:
• at Context.thenFn (https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:132380:26)
• at Context.then (https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:132819:21)
• at Context. (https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:144927:21)
• at https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:144402:33
• From previous event:
• at runCommand (https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:144381:14)
• at next (https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:144524:14)
• at https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:144552:16
• From previous event:
• at next (https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:144524:34)
• From previous event:
• at https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:144565:37
• From previous event:
• at run (https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:144558:19)
• at Object.cy. [as then] (https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:144970:11)
• at Context.runnable.fn (https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:145202:24)
• at callFn (https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:88335:21)
• at Test.../driver/node_modules/mocha/lib/runnable.js.Runnable.run (https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:88322:7)
• at https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:149207:28
• From previous event:
• at Object.onRunnableRun (https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:149195:20)
• at $Cypress.action (https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:141473:61)
• at Test.Runnable.run (https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:148003:13)
• at Runner.../driver/node_modules/mocha/lib/runner.js.Runner.runTest (https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:88994:10)
• at https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:89120:12
• at next (https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:88903:14)
• at https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:88913:7
• at next (https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:88815:14)
• at https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:88876:7
• at next (https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:149131:16)
• at https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:149152:11
• From previous event:
• at onNext (https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:149149:57)
• at done (https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:88275:5)
• at callFn (https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:88358:7)
• at Hook.../driver/node_modules/mocha/lib/runnable.js.Runnable.run (https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:88322:7)
• at https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:149207:28
• From previous event:
• at Object.onRunnableRun (https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:149195:20)
• at $Cypress.action (https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:141473:61)
• at Hook.Runnable.run (https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:148003:13)
• at next (https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:88837:10)
• at https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:88881:5
• at timeslice (https://react-redux.realworld.io/__cypress/runner/cypress_runner.js:82807:27)
Feature file
Feature: Ultimate Mortgage Calculator Basic Mortgage Calculator successful submit
Scenario: Check if Ultimate Mortgage Calculator Basic Mortgage Calculator returns successful messages
Given I open basic mortgage calculator page
When I enter the values for amount and term
|amount|term|
|250000| 27 |
|300000| 28 |
And I enter the values for interest rate and mortgage fees
|rate  | fee  |
|1.41  | 1198 |
|1.60  | 2500 |
Then I submit the form
Step definitions file code
import {Given, When, Then} from "cypress-cucumber-preprocessor/steps"
Given('Given I open basic mortgage calculator page', () => {
cy.visit('https://www.moneysavingexpert.com/mortgages/mortgage-rate-calculator/')
});
When('I enter the value for mortgage debt', datatable => {
datatable.hashes().forEach [element => {
cy.get('#amount').clear(element.amount)
cy.get('#amount').type(element.amount)
cy.get('#term').clear(element.term)
cy.get('#term').type(element.term)
}]
When('I enter the values for interest rate and mortgage fees', datatable => {
   datatable.hashes().forEach[element => {
    cy.get('#rate').clear(element.rate)
    cy.get('#rate').type(element.rate)
    cy.get('#fees-value').clear(element.fee)
    cy.get('#fees-value').type(element.fee)

}];

Then('I submit the form')
cy.get('.btn--default').click()
})
})
Package JSON
{
"name": "cypressger",
"version": "1.0.0",
"description": "mortgage cypress test",
"main": "index.js",
"scripts": {
"test": "test"
},
"author": "oluseun",
"license": "ISC",
"devDependencies": {
"cypress": "^4.5.0"
},
"cypress-cucumber-preprocessor": {
"nonGlobalStepDefinitions": true
}
}

Hello, please create a simple reproduction and push to github. To be honest that should be easier not only for us - but also for you, no need to copy and paste files to a text input :) Also from what you pasted we can't see what's the folder structure and it is crucial for the plugin to work properly.

Hi Lukasz,
Thanks for the quick response. I will try to push the simple reproduction
to github.
Kind regards
Olu
On Fri, May 22, 2020 at 9:13 AM Łukasz Gandecki<EMAIL_ADDRESS>wrote:

Hello, please create a simple reproduction and push to github. To be
honest that should be easier not only for us - but also for you, no need to
copy and paste files to a text input :) Also from what you pasted we can't
see what's the folder structure and it is crucial for the plugin to work
properly.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/TheBrainFamily/cypress-cucumber-preprocessor/issues/379#issuecomment-632561350,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AGMY2FRREDET2IQEHJP5TQTRSYXY3ANCNFSM4NHDNW4A
.

Hi Lukasz,
Please find below link to the simple reproduction github repository. I look
forward to your feedback.
Link - https://github.com/Olubolar614/olusimpletests
Kind regards
Olu
On Fri, May 22, 2020 at 9:13 AM Łukasz Gandecki<EMAIL_ADDRESS>wrote:

Hello, please create a simple reproduction and push to github. To be
honest that should be easier not only for us - but also for you, no need to
copy and paste files to a text input :) Also from what you pasted we can't
see what's the folder structure and it is crucial for the plugin to work
properly.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/TheBrainFamily/cypress-cucumber-preprocessor/issues/379#issuecomment-632561350,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AGMY2FRREDET2IQEHJP5TQTRSYXY3ANCNFSM4NHDNW4A
.

The problem is that you have Given inside the step definition...
Given('Given I open basic mortgage calculator page', () => {

Needs to change to:
Given('I open basic mortgage calculator page', () => {

Hi Dane,
Thanks for spotting the school boy error from my side. I would appreciate
if you can help to resolve this new issue relating
to clicking the form button. Then function "I submit the form" is throwing
up error and I have also committed my latest
code  in github . I look forward to hearing from you.
Link - https://github.com/Olubolar614/olusimpletests
Kind regards
Olu
On Sat, May 23, 2020 at 5:25 AM Dane Harnett<EMAIL_ADDRESS>wrote:

The problem is that you have Given inside the step definition...
Given('Given I open basic mortgage calculator page', () => {
Needs to change to:
Given('I open basic mortgage calculator page', () => {
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/TheBrainFamily/cypress-cucumber-preprocessor/issues/379#issuecomment-632982867,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AGMY2FTO2WNUCINTWBXEY3DRS5F3HANCNFSM4NHDNW4A
.

Thanks for helping out @dane-harnett .
This doesn't seem like a plugin issue so Im going to close it.

Hi Lukasz,
I agree, it is not a plugin issue, but my tests are still failing around
clicking the submit form button. I would appreciate, if someone can
help although you have already closed the issue ticket.
Kind regards
Olu
On Sat, May 23, 2020 at 8:04 AM Łukasz Gandecki<EMAIL_ADDRESS>wrote:

Closed #379
https://github.com/TheBrainFamily/cypress-cucumber-preprocessor/issues/379
.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/TheBrainFamily/cypress-cucumber-preprocessor/issues/379#event-3366767836,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AGMY2FRXWGLUS2D646GZP6LRS5YQFANCNFSM4NHDNW4A
.

Hi  Lukasz,
I am currently getting a new error whenever I run a cypress test in my
local environment. Test execution in
my local environment has been smooth (passing) for the past 2 weeks but
this error started occurring yesterday.
Error message - The plugins file is missing or invalid
Repo link - https://github.com/Olubolar614/olusimpletests
I look forward to hearing from you.
Kind regards
Oluseun
On Sat, May 23, 2020 at 8:04 AM Łukasz Gandecki<EMAIL_ADDRESS>wrote:

Closed #379
https://github.com/TheBrainFamily/cypress-cucumber-preprocessor/issues/379
.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/TheBrainFamily/cypress-cucumber-preprocessor/issues/379#event-3366767836,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AGMY2FRXWGLUS2D646GZP6LRS5YQFANCNFSM4NHDNW4A
.

Hi, @Olubolar614, your directory structure is wrong. Both the plugin and the integration directory should be inside a directory named cypress.


[SPARK-40786][SQL][TESTS] Check error classes in PlanParserSuite

What changes were proposed in this pull request?
This PR aims to replace 'intercept' with 'Check error classes' in PlanParserSuite.
Why are the changes needed?
The changes improve the error framework.
Does this PR introduce any user-facing change?
No.
How was this patch tested?
By running the modified test suite:
$ build/sbt "test:testOnly *PlanParserSuite"

Can one of the admins verify this patch?

cc @MaxGekk

+1, LGTM. Merging to master.
Thank you, @panbingkun.


option to not store command stdout/stderr

this would fix issue #373

Codecov Report

Merging #374 into master will decrease coverage by 0.08%.
The diff coverage is 50%.

@@            Coverage Diff             @@
##           master     #374      +/-   ##
==========================================
- Coverage   96.44%   96.36%   -0.09%
==========================================
  Files          12       12
  Lines        1042     1044       +2
  Branches      120      121       +1
==========================================
+ Hits         1005     1006       +1
  Misses         16       16
- Partials       21       22       +1

Impacted Files
Coverage Δ

pylxd/models/container.py
89.89% <50%> (-0.3%)
:arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bf43969...8c72aee. Read the comment docs.

Thanks for the patch.
However, I think there is a missed opportunity here, to drop buffering if a handler for that stream is supplied.  Then there wouldn't need to be an extra store parameter.
This would mean that to disable buffering (and through it away), you call execute() with:
container.execute(..., stdout_handler=lambda _: None)

This would stop buffering (i.e. the data property would be empty) and the lambda function would just drop the data.
Also, the coverage is down as the if statements added don't have coverage; the tests would need to be altered to include them as well, please.
Thanks.

Hi, the idea to only buffer output if no handler is given sounds great. I implemented this version and added some tests.


Added the logistic regression model with GridSearch

Fixes Issue🛠

Closes #1
Description👨💻

I ran the existing models in the notebook with GridSearchCV and I found the best model which worked with GridSearch. Logistic regression was the only model which gave better results than the existing ones.
Type of change📄

[] New feature (non-breaking change which adds functionality)

How this has been tested✅

I ran the notebook in Azure Machine Learning console by using Azure notebook.
Checklist✅

[] My code follows the style guidelines of this project
[] I have performed a self-review of my own code
[] I have commented my code, particularly in hard-to-understand areas
[] I have added demonstration in the form of GIF/video file
[] I am an Open Source Contributor

Screenshots/GIF📷

Pls do resolve the conflics and also run black main.py and then commit to pass the lint workflow @karthikbhandary2

ok @Rakesh9100

LGTM!! Merged 🎉

LGTM!! Merged 🎉 @karthikbhandary2

Thanks for the merge!


luci-mod-status: status/routing support for pbr

Provide comprehensive status information for routing.
Rename the "Status > Routes" page to "Status > Routing".
Unify sorting for the "Status" and "Network" menus.
Add tabs for IPv4 and IPv6 and reorganize the contents.
Display routing rules and their priorities for each protocol.
Policy-based routing is an increasingly popular problem.
Netifd natively supports policy-based routing:

The interface-specific options "ip4table" and "ip6table".
The routing rules using the "rule" and "rule6" sections.
LuCI is missing the information about routing rules.

Signed-off-by: Vladislav Grigoryev<EMAIL_ADDRESS>

Merged, thank you!


Use find_parent instead of parent.

Better, because it is sure to find the scsi parent.
You never know what intermediate parent might get interposed.
Better, becaus it does not rely on subsystem property
(which sometimes raises an AttributeError (fixed in pyudev 0.19)).
Signed-off-by: mulhern<EMAIL_ADDRESS>

Thanks!


Package panics when attempting to flatten struct with unexported fields

Package panics when attempting to flatten struct with unexported fields
go version: go1.13
OS: macOS mojave (10.14.6)
sample code:
package main

import "github.com/chidiwilliams/flatbson"
import "time"
import "fmt"

func main() {
  a := struct {
    B time.Time `bson:"b,omitempty"` // time.Time has 3 unexported fields
  }{time.Now()}
  fmt.Println(flatbson.Flatten(a))
}

expected output:
map[b:2020-05-22 00:20:15.63927 +0100 WAT m=+0.003913472]
actual output:
panic: reflect.Value.Interface: cannot return value obtained from unexported field or method

goroutine 1 [running]:
reflect.valueInterface(0x11b6640, 0xc00000c300, 0xab, 0x1, 0x1390240, 0xc000016600)
        /usr/local/go/src/reflect/value.go:1014 +0x1bc
reflect.Value.Interface(...)
        /usr/local/go/src/reflect/value.go:1003
github.com/chidiwilliams/flatbson.flattenFields(0x11f5380, 0xc00000c300, 0x99, 0xc000066930, 0xc00001660a, 0x2, 0x1, 0xc00001660a)
        /Users/oghogho/go/pkg/mod/github.com/chidiwilliams/flatbson@v0.1.4/flatten.go:78 +0x3ce
github.com/chidiwilliams/flatbson.flattenFields(0x11ccbe0, 0xc00000c300, 0x99, 0xc000066930, 0x0, 0x0, 0xbb3ae01, 0xc00009bec8)
        /Users/oghogho/go/pkg/mod/github.com/chidiwilliams/flatbson@v0.1.4/flatten.go:67 +0x249
github.com/chidiwilliams/flatbson.Flatten(0x11ccbe0, 0xc00000c300, 0x11ccbe0, 0xc00000c300, 0x103a067)
        /Users/oghogho/go/pkg/mod/github.com/chidiwilliams/flatbson@v0.1.4/flatten.go:42 +0x10e
main.main()
        /Users/oghogho/Desktop/Softcom/tester/main.go:11 +0x75
exit status 2

Good catch, thanks. Fixed in v0.2

@chidiwilliams Looks like I'm getting the same issue even in 0.3.0.
panic: reflect.Value.Interface: cannot return value obtained from unexported field or method

@8arcturus Could you please share some example code?

Apologize for late reply. We had a temporary work around for this issue. Now we are stuck with the same issue mentioned here.
I'm using a proto generate stub to which I cannot edit unexported fields to add custom tag to omitempty.
Something like below:
`
type IssueWithUnexported struct {
state         protoimpl.MessageState
sizeCache     protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
   EntityName string `bson:"entityName"`
SystemName string `bson:"systemName"`
UniqueId   string `bson:"uniqueId"`

}
var in *IssueWithUnexported
in = &IssueWithUnexported{
EntityName: "test",
SystemName: "test",
UniqueId: "test",
}
flattenedBson, flatErr := flatbson.Flatten(&in) // Would throw the following error
// panic: reflect.Value.Interface: cannot return value obtained from unexported field or method
`


Always put a space after dyn in macro pretty-printing

Fixes #11100.

Thanks!
bors r+

bors retry

Does this insert an extra space on dyn Trait?

dyn Trait is being hit in the first arm already, so is impl Trait. This mainly fixes dyn::Trait being dyn ::Trait now, impl is not affected so we should add that as well ye


Fix hive to_date function

to_date function in Hive is different with the others type since Caravel can connect to Hive through PyHive.

Document

Coverage decreased (-0.06%) to 81.124% when pulling 3a79971f51fe9d3cde7d859c70bf4b46e4f8e79e on giaosudau:master into 24e85f52b4ead7f8f70b8d3d7e5724d8ca597bd9 on airbnb:master.

Coverage decreased (-0.2%) to 81.002% when pulling 702f1cbd7d57c61c0635b7223a48e41274ef492a on giaosudau:master into 2b237f483f305bb265980d9b2f272d99fb974c47 on airbnb:master.

To me this looks unneeded as hive has timestamps field that should supports our default dttm format:
https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Types#LanguageManualTypes-Timestamps

We'll take a different approach, there's an issue open about this.


RDP module doesn't shows correct result

Describe the bug
When trying to log in with RDP module, it gives the following error:

But I can log in manually with the same creds:

To Reproduce
Expected behavior
It should output that I can log in or 'pwd3d!'
Crackmapexec info

OS: Kali 2022.4
Version of CME 5.4.0

hi i have the same issue how did you fixed  ?

Hi, there was a bug in the rdp protocol which got fixed with the commit d00a9bafeb0fc6df0718486ded5087b55b0bd50b.
As there was no official release since then it might be possible that your version does not have the bugfix if you downloaded crackmapexec via apt or pip (/pipx).
You can try to clone the repository and install it with pipx install .. That might solve your problem (and maybe was the original problem here).


Allow ReactCommon/Folly to be used in Swift libraries (DEFINES_MODULE)

Summary
Swift Pods require the use of modular headers to be statically linked. To interop with Objective-C modules, you need to make the Objective-C module "define a Module", that is modular header export.
This is already the case for a few podspecs so they can be consumed in Swift libraries, but ReactCommon and RCT-Folly don't do this yet and therefore this breaks in a few libraries of mine, for example see this issue: https://github.com/mrousavy/react-native-vision-camera/issues/195.
If I were to include ReactCommon or RCT-Folly in my Swift library's podspec, the following error arises:
[!] The following Swift pods cannot yet be integrated as static libraries:

The Swift pod `VisionCamera` depends upon `RCT-Folly`, which does not define modules.
To opt into those targets generating module maps (which is necessary to import them from Swift
when building as static libraries), you may set `use_modular_headers!` globally in your Podfile, or
specify `:modular_headers => true` for particular dependencies.

So this PR fixes this issue by allowing Swift libraries to consume the ReactCommon and RCT-Folly podspecs since they now export modular headers.
Changelog

[General] [Fixed] - Expose Modular Headers for ReactCommon podspec
[General] [Fixed] - Expose Modular Headers for RCT-Folly podspec
Test Plan

Add s.dependency "ReactCommon" or RCT-Folly to a Swift pod and see what happens. (See https://github.com/mrousavy/react-native-vision-camera/pull/273)

Why do the tests fail and how can I reproduce this locally?

@mrousavy it's just a syntax error:

the line 37 of ReactCommon.podspec is missing a comma.

ah, whoops. thanks!

Also, there is something weird with the CircleCI configuration. It is not running all the Hermes jobs as it should.

Will take care of apply the same changes on Monday, PR is pretty old, now...(2021)

Hey - whoops sorry forgot to reply here for two years lol - I can rebase on Monday :)


Error when installing component.

Hi,  Been using this for over a year now and wanted to reinstall it ontop a new ESP32 but i keep getting error when ESPhome tries to pull the installation.
Compiling /data/livingroom-esp32/.pioenvs/livingroom-esp32/src/esphome/components/sensor/filter.cpp.o
src/esphome/components/idasen_desk_controller/idasen_desk_controller.cpp: In member function 'virtual void esphome::idasen_desk_controller::IdasenDeskControllerComponent::gattc_event_handler(esp_gattc_cb_event_t, esp_gatt_if_t, esp_ble_gattc_cb_param_t*)':
src/esphome/components/idasen_desk_controller/idasen_desk_controller.cpp:68:61: error: 'class esphome::ble_client::BLEClient' has no member named 'gattc_if'
           esp_ble_gattc_register_for_notify(this->parent()->gattc_if, this->parent()->remote_bda, this->output_handle_);
                                                             ^
src/esphome/components/idasen_desk_controller/idasen_desk_controller.cpp:68:87: error: 'class esphome::ble_client::BLEClient' has no member named 'remote_bda'
           esp_ble_gattc_register_for_notify(this->parent()->gattc_if, this->parent()->remote_bda, this->output_handle_);
                                                                                ^
src/esphome/components/idasen_desk_controller/idasen_desk_controller.cpp:101:50: error: 'class esphome::ble_client::BLEClient' has no member named 'conn_id'
       if (param->read.conn_id != this->parent()->conn_id)
                                                  ^
src/esphome/components/idasen_desk_controller/idasen_desk_controller.cpp:115:52: error: 'class esphome::ble_client::BLEClient' has no member named 'conn_id'
       if (param->notify.conn_id != this->parent()->conn_id || param->notify.handle != this->output_handle_)
                                                    ^
src/esphome/components/idasen_desk_controller/idasen_desk_controller.cpp: In member function 'void esphome::idasen_desk_controller::IdasenDeskControllerComponent::write_value_(uint16_t, short unsigned int)':
src/esphome/components/idasen_desk_controller/idasen_desk_controller.cpp:141:65: error: 'class esphome::ble_client::BLEClient' has no member named 'gattc_if'
   esp_err_t status = ::esp_ble_gattc_write_char(this->parent()->gattc_if, this->parent()->conn_id, handle, 2, data,
                                                                 ^
src/esphome/components/idasen_desk_controller/idasen_desk_controller.cpp:141:91: error: 'class esphome::ble_client::BLEClient' has no member named 'conn_id'
   esp_err_t status = ::esp_ble_gattc_write_char(this->parent()->gattc_if, this->parent()->conn_id, handle, 2, data,
                                                                                ^
src/esphome/components/idasen_desk_controller/idasen_desk_controller.cpp: In member function 'void esphome::idasen_desk_controller::IdasenDeskControllerComponent::read_value_(uint16_t)':
src/esphome/components/idasen_desk_controller/idasen_desk_controller.cpp:152:47: error: 'class esphome::ble_client::BLEClient' has no member named 'gattc_if'
       esp_ble_gattc_read_char(this->parent()->gattc_if, this->parent()->conn_id, handle, ESP_GATT_AUTH_REQ_NONE);
                                               ^
src/esphome/components/idasen_desk_controller/idasen_desk_controller.cpp:152:73: error: 'class esphome::ble_client::BLEClient' has no member named 'conn_id'
       esp_ble_gattc_read_char(this->parent()->gattc_if, this->parent()->conn_id, handle, ESP_GATT_AUTH_REQ_NONE);
                                                                         ^
*** [/data/livingroom-esp32/.pioenvs/livingroom-esp32/src/esphome/components/idasen_desk_controller/idasen_desk_controller.cpp.o] Error 1

The same problem with the ESPHome 2022.9.4.

That PR looks like a fix of the problem.

@j5lien could you merge the PR please?

A temporary solution:
external_components:
  - source: github://j5lien/esphome-idasen-desk-controller@pull/51/head

The fix has been merged!


DeltaLM: how to finetune on low-resource datasets

Describe
Model I am using: DeltaLM
Hi, I am trying to finetune DeltaLM on a low resource text generation task. And I have tried to prepare the data as promped in the iwslt bash files. However there are two things that I am not sure about:

Why does the README.md in deltaLM suggested a total batch size of 4096128 tokens, while the bash file sets the effective batch size to 10241*N_gpu tokens?
And if I stick with 4096*128 tokens, it could be quite hard to finetune on a small dataset, especially with 4000 steps of warming up.

So is there anything I can do to improve the situation, or any finetuning tips for small datasets? Thanks!

The batch size of 4096128 tokens is suggested by https://arxiv.org/abs/1806.00187, which proves to have better performance than the small batch. This is actually empirical and works for a large dataset. You can use a smaller batch size (like 40962 or so) for the small dataset.


Strong Search engine in "Open with" right click context menu

As the title says, it would be really awesome to have some sort of search engine directly integrated in the "Open With" right click context  menu.
Current Scenario:

right click on the file you want to open with a custom .exe;
choose "Open With" and wait for the relative window to pop up;
check the list and  scroll down to the end;
click on "Find another app in this PC"
manually locate inside windows explorer the locaton of the .exe you want to use;
do everything again from the start if you want that program to be the default one.

Enanched Scenario:

right click on the file ---> open with
start typing the name of the .exe you want to use
select the .exe in the search's result list
flag the nearby checkbox if you want to make it default

+1
Cheers…
Cary R. Wagner
????R.????
Director, Global Engineering Cloud & Automation Services
GECAS | Engineering Operation Services | PPD
Hitachi Vantara
t:<PHONE_NUMBER> | f:<PHONE_NUMBER>
Call Cary with Skype 4 Biz!
e<EMAIL_ADDRESS>twitter: https://www.linkedin.com/in/caryrw/
2845 Lafayette St., Mail Stop U566, Santa Clara, CA 95050 USA
www.HitachiVantara.comhttp://www.HitachiVantara.com | community.HitachiVantara.com
“Be not afraid of going slowly. Be afraid only of stopping.”
-- A Chinese Proverb
This message and any attachment are proprietary and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, you are hereby notified that you have received this transmittal in error. In this case, any review, dissemination, distribution, or copying of this transmittal is strictly prohibited. If you have received this communication in error, please notify us immediately by reply e-mail and immediately delete this message and all its attachments.

From: Gabe<EMAIL_ADDRESS>Sent: Sunday, May 26, 2019 10:39:04 AM
To: microsoft/PowerToys
Cc: Subscribed
Subject: [microsoft/PowerToys] Search field in "Open with" right click context menu (#124)
***** EXTERNAL EMAIL *****
As the title says, it would be really awesome to have some sort of search engine directly integrated in the "Open With" right click context menu.
Current Scenario:

right click on the file you want to open with a custom .exe;
choose open with and wait for the "Open With" window to pop up;
check the list and scroll down to the end;
click on "Find another app in this PC"
manually locate inside windows explorer the locaton of the .exe you want to use;
do everything again from the start if you want that program to be the default one.

Enanched Scenario:

right click on the file ---> open with
start typing the name of the .exe you want to use
flag the checkbox if you want to make it default
enjoy!

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHubhttps://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FPowerToys%2Fissues%2F124%3Femail_source%3Dnotifications%26email_token%3DABWSQUFQ52WMJTVXK2JTHELPXLDLRA5CNFSM4HPXD542YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GV452KA&data=01|01|Cary.Wagner%40HitachiVantara.com|24d2b8e1769149289d5108d6e2010c6c|18791e1761594f52a8d4de814ca8284a|0&sdata=jodXZ4m7jJJTgrjmz6%2F0dYsopYWW7sJpCzLafHSNJz0%3D&reserved=0, or mute the threadhttps://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FABWSQUDN7F2J5MJZT5QFV23PXLDLRANCNFSM4HPXD54Q&data=01|01|Cary.Wagner%40HitachiVantara.com|24d2b8e1769149289d5108d6e2010c6c|18791e1761594f52a8d4de814ca8284a|0&sdata=yr9p%2BZgmcGr%2F8n6nupHEmQYgEdzZV9WeO6ld9xNICu0%3D&reserved=0.

This is a great suggestion.  We will definitely add this to the backlog of ideas.  Thanks!


ARROW-12189: [C++][Gandiva] Implement TO_TIME, TO_TIMESTAMP, UNIX_TIMESTAMP and IS_DATE functions

9877

 Quality gate: Passed
 Everything looks good
Details


Update tkinter_tooltip.py

added the topmost attribute

I see what you're trying to achieve here. We have to be careful using .attributes('-topmost', True) as this not only brings it on top of the parent window it also brings it on top of ALL windows on your display no matter what.
Let's work together to find a modular solution to what you'd like to achieve. Is there anyway you can provide a very minimal working example of your GUI and how you want it to behave.

`def change_aot():
app.attributes('-topmost', aot_var.get())
app = customtkinter.CTk()
app.attributes('-topmost', True)
aot_switch = customtkinter.CTkSwitch(app, width=100,text="AoT",command=change_aot, variable=aot_var, offvalue="False", onvalue="True")
CustomTooltipLabel(anchor_widget=aot_switch, text="Always on Top", background="grey", foreground="black", width=15)
app.mainloop()`

Unfortunately this is not enough for me to produce your error with or without topmost true. I'll need more code, like a complete mocked up version of it, doesn't have to be the same code, just enough for me to actually produce the error.
Screen shots of what it does with vs without topmost true would be great so I can see what you're expecting.
ATM the chunk of code you gave me can't even be executed as it's trying to set attributes to something that doesn't yet exist at all.

Commenting out the code that breaks it at least from starting just produces an empty window no switch.

I'd like to come up with a more permanent flexible solution but I'll need more than this atm. Thanks!

There is nothing sensitive in my code, so here it is in its entirety.
To produce my issue, this first screenshot is with my GUI topmost, and your
tooltip is behind it. The second screenshot is with AoT disabled on mine
and the tooltip works as intended. The 3rd is where I added the topmost
line in your code, and the 4th is it working with AoT on.
I understand the concern about the tooltip showing above other windows, but
that would be a very niche issue, and only for tooltips that are massive.
Maybe a switch you can pass to the command to turn AoT on?
[image: tooltip1.png]
[image: tooltip2.png]
[image: code.png]
[image: tooltip3.png]
On Tue, Aug 22, 2023 at 3:02 PM Jessie Wilson @.***>
wrote:

Unfortunately this is not enough for me to produce your error with or
without topmost true. I'll need more code, like a complete mocked up
version of it, doesn't have to be the same code, just enough for me to
actually produce the error.
Screen shots of what it does with vs without topmost true would be great
so I can see what you're expecting.
ATM the chunk of code you gave me can't even be executed as it's trying to
set attributes to something that doesn't yet exist at all.
[image: image]
https://user-images.githubusercontent.com/48299282/262501610-bfde73de-d05c-4696-9a6c-3f8a0f016f05.png
Commenting out the code that breaks it at least from starting just
produces an empty window no switch.
[image: image]
https://user-images.githubusercontent.com/48299282/262501740-09119be0-8ef9-45ce-8597-0f9f1d26e74e.png
I'd like to come up with a more permanent flexible solution but I'll need
more than this atm. Thanks!
—
Reply to this email directly, view it on GitHub
https://github.com/jlw4049/Custom-Tkinter-Tooltip/pull/2#issuecomment-1689034453,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AXDHU75OXVOLNPYRA4EN4HLXWU3ADANCNFSM6AAAAAA3XMVSWA
.
You are receiving this because you authored the thread.Message ID:
@.***>

There is nothing sensitive in my code, so here it is in its entirety. To produce my issue, this first screenshot is with my GUI topmost, and your tooltip is behind it. The second screenshot is with AoT disabled on mine and the tooltip works as intended. The 3rd is where I added the topmost line in your code, and the 4th is it working with AoT on. I understand the concern about the tooltip showing above other windows, but that would be a very niche issue, and only for tooltips that are massive. Maybe a switch you can pass to the command to turn AoT on? [image: tooltip1.png] [image: tooltip2.png] [image: code.png] [image: tooltip3.png]
…
On Tue, Aug 22, 2023 at 3:02 PM Jessie Wilson @.> wrote: Unfortunately this is not enough for me to produce your error with or without topmost true. I'll need more code, like a complete mocked up version of it, doesn't have to be the same code, just enough for me to actually produce the error. Screen shots of what it does with vs without topmost true would be great so I can see what you're expecting. ATM the chunk of code you gave me can't even be executed as it's trying to set attributes to something that doesn't yet exist at all. [image: image] https://user-images.githubusercontent.com/48299282/262501610-bfde73de-d05c-4696-9a6c-3f8a0f016f05.png Commenting out the code that breaks it at least from starting just produces an empty window no switch. [image: image] https://user-images.githubusercontent.com/48299282/262501740-09119be0-8ef9-45ce-8597-0f9f1d26e74e.png I'd like to come up with a more permanent flexible solution but I'll need more than this atm. Thanks! — Reply to this email directly, view it on GitHub <#2 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXDHU75OXVOLNPYRA4EN4HLXWU3ADANCNFSM6AAAAAA3XMVSWA . You are receiving this because you authored the thread.Message ID: @.>

Not seeing any of the code or images. You can paste the code how you did before and just copy, right click and paste your images into this window for them to be visible.

[image: image.png]
[image: image.png]
[image: image.png]
[image: image.png]
Here is a link to my file on my OneDrive:
https://ideafamilies-my.sharepoint.com/:u:/g/personal/kcarndt_ideafamilies_org/EW7AR5oUBxdPhI8tAbd9rIEB56DoJd23kkSng-g-p0mTXg?e=ZcGwme
On Tue, Aug 22, 2023 at 9:10 PM Jessie Wilson @.***>
wrote:

There is nothing sensitive in my code, so here it is in its entirety. To
produce my issue, this first screenshot is with my GUI topmost, and your
tooltip is behind it. The second screenshot is with AoT disabled on mine
and the tooltip works as intended. The 3rd is where I added the topmost
line in your code, and the 4th is it working with AoT on. I understand the
concern about the tooltip showing above other windows, but that would be a
very niche issue, and only for tooltips that are massive. Maybe a switch
you can pass to the command to turn AoT on? [image: tooltip1.png] [image:
tooltip2.png] [image: code.png] [image: tooltip3.png]
… <#m_5489814257211604747_>
On Tue, Aug 22, 2023 at 3:02 PM Jessie Wilson @.> wrote: Unfortunately
this is not enough for me to produce your error with or without topmost
true. I'll need more code, like a complete mocked up version of it, doesn't
have to be the same code, just enough for me to actually produce the error.
Screen shots of what it does with vs without topmost true would be great so
I can see what you're expecting. ATM the chunk of code you gave me can't
even be executed as it's trying to set attributes to something that doesn't
yet exist at all. [image: image]
https://user-images.githubusercontent.com/48299282/262501610-bfde73de-d05c-4696-9a6c-3f8a0f016f05.png
https://user-images.githubusercontent.com/48299282/262501610-bfde73de-d05c-4696-9a6c-3f8a0f016f05.png
Commenting out the code that breaks it at least from starting just produces
an empty window no switch. [image: image]
https://user-images.githubusercontent.com/48299282/262501740-09119be0-8ef9-45ce-8597-0f9f1d26e74e.png
https://user-images.githubusercontent.com/48299282/262501740-09119be0-8ef9-45ce-8597-0f9f1d26e74e.png
I'd like to come up with a more permanent flexible solution but I'll need
more than this atm. Thanks! — Reply to this email directly, view it on
GitHub <#2 (comment)
https://github.com/jlw4049/Custom-Tkinter-Tooltip/pull/2#issuecomment-1689034453>,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AXDHU75OXVOLNPYRA4EN4HLXWU3ADANCNFSM6AAAAAA3XMVSWA
https://github.com/notifications/unsubscribe-auth/AXDHU75OXVOLNPYRA4EN4HLXWU3ADANCNFSM6AAAAAA3XMVSWA
. You are receiving this because you authored the thread.Message ID: @.>
Not seeing any of the code or images. You can paste the code how you did
before and just copy, right click and paste your images into this window
for them to be visible.
—
Reply to this email directly, view it on GitHub
https://github.com/jlw4049/Custom-Tkinter-Tooltip/pull/2#issuecomment-1689290396,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AXDHU7YFZFJQ6FLBBPLHMDLXWWGDRANCNFSM6AAAAAA3XMVSWA
.
You are receiving this because you authored the thread.Message ID:
@.***>

I'll look at this tomorrow


Update gym to gymnasium

What does this PR do?
Removes the gym dependency and add the new gymnasium library. This solves installation problem on some envirments due to updates in setuptools, and serves as a general quality-of-life update to the example.

Codecov Report

Merging #3133 (f6ccf6e) into main (9e85005) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #3133   +/-   ##
=======================================
  Coverage   81.94%   81.94%
=======================================
  Files          55       55
  Lines        6037     6037
=======================================
  Hits         4947     4947
  Misses       1090     1090


IBM customization

Description of your changes
Change image building targets

Fixes #51087
I have:

[x] Read and followed Crossplane's contribution process.
[x] Run make reviewable test to ensure this PR is ready for review.

How has this code been tested

ok


Swift 4 support

Overall

Update project to Swift 4
Enable Xcode suggested warnings
Set deployment target to 9.0

@sharplet pointed this PR to master. I'll also delete develop.


[feature] Execute a command on change detected

Some software only has a CLI interface and no way to communicate with it, would be superawesome to call some CLI command on change detected.
For example - Would be amazing if it could trigger a run of https://github.com/ArchiveBox/ArchiveBox
unfortunately it looks like it doesn't have a working API

No REST API https://github.com/ArchiveBox/ArchiveBox/issues/496
Looks like a working Python API https://docs.archivebox.io/en/latest/modules.html
Can be driven by a CLI call https://github.com/ArchiveBox/ArchiveBox/wiki/Usage#CLI-Usage

In this case of archiving, i think it's important to be 100% sure the command is run/queued, so in this case maybe use some queue mechanism

should be disabled by default for security reasons, but enabled with a env var ENABLE_CLI_TRIGGER=1
But should still be able to see it available in the UI, just disabled

I would like to see this feature!
Suggestion:
How to Execute Shell Commands with Python
https://janakiev.com/blog/python-shell-commands/

Would be nice to trigger for example a Docker container image rebuild if an important update occurs on a changelog website. :-) So basically a shell execute would be sufficient. Awesome project btw., thank you!


Ruleset file is inferred from workspace directory and not from directory of the file that gets validated

Describe the bug
According to the documentation of the configuration option "Spectral: Ruleset File" the default ruleset file "is a .spectral.yml/.spectral.json in the same folder as the document being validated". However, this does not work. The ruleset file is only recognized if it is in the workspace root.
This is impractical for having documentation in subfolders, because it requires the ruleset file to be in the root directory of the workspace.
To Reproduce

Given any specification document in a subdirectory that does not match some rule.
Add .spectral.yml in this subdirectory and turn off the conflicting rule.
The conflicting rule is still validated against.

Expected behavior
The extension should behave as documented. The ruleset file should be looked up from the directory the document is in. Alternatively,  the documentation of the "Spectral: Ruleset File" should be adjusted.
Environment:

Extension version: 1.0.0
VS Code version: 1.70.2
Operating System: Windows 10 running VS Code with the Remote Extension on WSL

Additional context
To not break existing setups, both directories could be used to find a ruleset configuration file. This would be a new feature though.

I've encountered this exact same issue. To test this I created a .spectral.yml file in my API folder with the following content:
rules:
  openapi-v3-info-contact:
    description: Ensures that all APIs have contact information.
    message: API must have a contact information available.
    given: $.info
    severity: error
    recommended: true
    type: style
    formats:
      - oas3
    then:
      field: contact
      function: truthy

Even though I only have a single rule configured the extension reports a number of additional opinionated rules in addition to any parser issues spectral always detects.
If I instead either move the .spectral.yml file to the workspace root folder, or use the Spectral CLI to do the linting within the folder containing the API file, the single spectral rule will be detected (along with any parser issues).
VS Code's support for multi-root workspaces seems to be the only workaround for the impracticality issue @richardboehme mentions above of having a single spectral configuration file at the workspace level. But using multi-root workspaces this way is trading one form of impracticality (single config file for all documentation subfolders) for another (creating a new workspace root for each documentation subfolder). Either approach seems suboptimal.


circtl must work with containerd 1.5 - allow the fallback logic to CRI API v1alpha2

This is a follow up from https://github.com/kubernetes-sigs/cri-tools/pull/878#issuecomment-1022493135
Containerd 1.5 only implements CRI API v1alpha2 and cri tools must support the same runtimes k8s supports. So there should be a fallback logic to v1alpha2.

@saschagrunert what is the versioning story of CRI tools for CRI-O? How many versions back customers will expect to be supported?

cc: @qiutongs

@saschagrunert what is the versioning story of CRI tools for CRI-O? How many versions back customers will expect to be supported?

Since CRI-O versionizes together with Kubernetes, we would have any issue with a breaking change here. We also support CRI v1 since a couple of releases (v1.21 I guess), so we're already good to go.

One way to approach this would be to switch to the internal runtime and image services completely:
https://github.com/kubernetes-sigs/cri-tools/blob/8553b616d79b7753f4eda5fb9144cd8ca9eb9764/cmd/crictl/main.go#L135-L137
This service already features the conversion of the types, but it would mean that we bound the kubelet code tighter to crictl.

Same problem with Docker (cri-dockerd), I guess it deserves a special issue.
docker@minikube:~$ crictl --version
crictl version v1.21.0
docker@minikube:~$ crictl version
Version:  0.1.0
RuntimeName:  docker
RuntimeVersion:  20.10.12
RuntimeApiVersion:  1.41.0
docker@minikube:~$ cri-dockerd --version
cri-dockerd 0.2.0 (a4d1895)
docker@minikube:~$ crictl info
{
  "status": {
    "conditions": [
      {
        "type": "RuntimeReady",
        "status": true,
        "reason": "",
        "message": ""
      },
      {
        "type": "NetworkReady",
        "status": true,
        "reason": "",
        "message": ""
      }
    ]
  }
}

When upgrading cri-tools to latest/greatest (i.e. 1.24 pre-release), it no longer works:
docker@minikube:~$ ./crictl-1.23.0 --version
crictl version v1.23.0
docker@minikube:~$ ./crictl-1.23.0 info
{
  "status": {
    "conditions": [
      {
        "type": "RuntimeReady",
        "status": true,
        "reason": "",
        "message": ""
      },
      {
        "type": "NetworkReady",
        "status": true,
        "reason": "",
        "message": ""
      }
    ]
  }
}
docker@minikube:~$ ./crictl --version
crictl version 1.23.0-18-g0871ebbc
docker@minikube:~$ ./crictl info
FATA[0000] getting status of runtime: rpc error: code = Unimplemented desc = unknown service runtime.v1.RuntimeService

Since CRI-O versionizes together with Kubernetes, we would have any issue with a breaking change here. We also support CRI v1 since a couple of releases (v1.21 I guess), so we're already good to go.

I guess you mean "we would not have any" ? Normally CRI-O lags the Kubernetes releases for some time, but if it has already been implemented in a release version then I suppose you could* use cri-o v1.23.1 with kubernetes v1.24.0 ?
* I think we are currently using crio 1.22.1 with k8s 1.23.3.

I guess you mean "we would not have any" ?

Yes, sorry for the confusion.

Docker now installs containerd 1.5, fwiw

Fixed with https://github.com/kubernetes-sigs/cri-tools/pull/889


Modify TwitchBot initialization

Right now the system initializes and executes in the mod's main entry loop, which on first time install, is before the config json is created. This ends up leaving users having to restart even after configuring, which can be confusing and also breaks GMCM's mantra that "configs can be changed without a restart".
If we modified the initialization to be during loading of a save, then we can have a more straightforward system that doesn't require user restarts.

That would definitely make more sense, yup. I can look into it sometime, unless you were already intending to.


Illegal invocation with langchain/llms/bedrock/web on Cloudflare Worker

declare type Env = {
  ENVIRONMENT: "dev" | "production";
  BEDROCK_AWS_ACCESS_KEY_ID: string;
  BEDROCK_AWS_SECRET_ACCESS_KEY: string;
};

import { Bedrock } from "langchain/llms/bedrock/web";

export default {
  async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise<Response> {
    const model = new Bedrock({
      model: "anthropic.claude-v2",
      region: "us-east-1",
      credentials: {
        accessKeyId: env.BEDROCK_AWS_ACCESS_KEY_ID,
        secretAccessKey: env.BEDROCK_AWS_SECRET_ACCESS_KEY
      },
      streaming: false,
      verbose: true
    });
    console.log(model);
    const text = "Human: What would be a good company name for a company that makes colorful socks?";

    console.log(text);
    const llmResult = await model.invoke(text);

    console.log(llmResult);
    return new Response(llmResult);
  },
};

Bedrock {
  lc_serializable: true,
  lc_kwargs: Object,
  lc_runnable: true,
  verbose: true,
  callbacks: undefined
  ...
}
Human: What would be a good company name for a company that makes colorful socks?
[llm/start] [1:llm:Bedrock] Entering LLM run with input: {
  "prompts": [
    "Human: What would be a good company name for a company that makes colorful socks?"
  ]
}
[llm/error] [1:llm:Bedrock] [18ms] LLM run errored with error: "Illegal invocation"
[mf:err] TypeError: Illegal invocation
    at Object.apply (/private/var/folders/wd/0gfsfmwx4b91h52nfbbfrb5m0000gn/T/tmp-831-V0NWW140FaH9/checked-fetch.js:28:18)
    at null.<anonymous> (/Users/dave/Work/langchain-workers/langchain-worker/node_modules/langchain/dist/llms/bedrock/web.js:204:105)
    at onFailedAttempt (/Users/dave/Work/langchain-workers/langchain-worker/node_modules/langchain/dist/util/async_caller.js:89:50)
    at RetryOperation._fn (/Users/dave/Work/langchain-workers/langchain-worker/node_modules/p-retry/index.js:50:18)
    at RetryOperation.attempt (/Users/dave/Work/langchain-workers/langchain-worker/node_modules/retry/lib/retry_operation.js:116:8)
    at null.<anonymous> (/Users/dave/Work/langchain-workers/langchain-worker/node_modules/p-retry/index.js:48:12)
    at [object Object]
    at pRetry (/Users/dave/Work/langchain-workers/langchain-worker/node_modules/p-retry/index.js:39:36)
    at queue.add.throwOnTimeout (/Users/dave/Work/langchain-workers/langchain-worker/node_modules/langchain/dist/util/async_caller.js:89:37)
    at run (/Users/dave/Work/langchain-workers/langchain-worker/node_modules/p-queue/dist/index.js:157:104)

I was following the docs at: https://js.langchain.com/docs/integrations/llms/bedrock

It's this bit of code that seems to be causing the issue, not sure why.
https://github.com/langchain-ai/langchainjs/blob/0524fb6a0d0b4d99c494803e5cb254f312cd6ff9/langchain/src/llms/bedrock/web.ts#L210-L220

@jacoblee93 Sorry for the random ping, thought you might have some experience with this. 😄

I wonder if it's trying to use a secure context - will see if I can get to the bottom of it!

But also CC @mhart

So this makes zero sense to me... but defining my own fetch function removes the error. (It's super ugly though.)
declare type Env = {
  ENVIRONMENT: "dev" | "production";
  BEDROCK_AWS_ACCESS_KEY_ID: string;
  BEDROCK_AWS_SECRET_ACCESS_KEY: string;
};

import { Bedrock } from "langchain/llms/bedrock/web";

function myFetch(input: RequestInfo, init?: RequestInit<CfProperties<unknown>> | undefined): Promise<Response> {
  console.log("myFetch", input, init);
  return fetch(input, init);
}

export default {
  async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise<Response> {
    const model = new Bedrock({
      model: "anthropic.claude-v2",
      region: "us-east-1",
      credentials: {
        accessKeyId: env.BEDROCK_AWS_ACCESS_KEY_ID,
        secretAccessKey: env.BEDROCK_AWS_SECRET_ACCESS_KEY
      },
      streaming: false,
      verbose: true,
      fetchFn: myFetch
    });
    console.log(model);
    const text = "Human: What would be a good company name for a company that makes colorful socks?";

    console.log(text);
    const llmResult = await model.invoke(text);

    console.log(llmResult);
    return new Response(llmResult);
  },
};

Could be the signed fetch package doing something funny?

https://github.com/cloudflare/workers-sdk/issues/3478
Might be related to this. Still not sure how to fix it though.

Thanks for flagging the issue! Binding fetch with globalThis should work fine for on wrangler dev.

Mind showing an example? =) I thought I had already tried that and ended up with the same error.

Yeah, this was my attempt that doesn't work (same error as before):
const model_ant = new BedrockChat({
  model: "anthropic.claude-v2",
  region: "us-east-1",
  credentials: {
    accessKeyId: env.BEDROCK_AWS_ACCESS_KEY_ID,
    secretAccessKey: env.BEDROCK_AWS_SECRET_ACCESS_KEY
  },
  fetchFn: globalThis.fetch,
  maxTokens: 2048,
  verbose: true,
  maxRetries: 0,
  temperature: 0
});

Thanks, I can confirm #3302 fixed it!

Thanks again for the report!