code running

We have written the needed data into your clipboard because it was too large to send. Please paste.
Issue Type: Bug
whenever i try to run my program it does not showing me any output this problem happening from yesterday please give me solution.

How are you trying to run your program?
Please provide reproducible steps.

I am using c language
On Sun, Mar 27, 2022, 9:21 PM Andre Weinand @.***>
wrote:

What programming language are you using?
How are you trying to run your program?
Please provide reproducible steps.
—
Reply to this email directly, view it on GitHub
https://github.com/microsoft/vscode/issues/146101#issuecomment-1079958526,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AYNKMR4XTCX37WNVBLBWCS3VCCG2TANCNFSM5RWNKYAQ
.
You are receiving this because you authored the thread.Message ID:
@.***>

/extCpp


Cleanup Minor Bugs in FastHotStuffConsensus

[!WARNING]
This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

Current dependencies on/for this PR:

feature/pos-syncing-and-steady-state

PR #952

PR #953   👈

This stack of pull requests is managed by Graphite.


fixing column width logic

The current implementation ignores the manually-defined column widths under several circumstances.
If a user goes through the effort of specifically setting min and max width values for a particular column, those should be used above all else.
It is only when a more granular width setting is not provided that the global / auto-detect values should be used.

I see. Thanks for this!
But wait, I test it, the result is not  expected :crying_cat_face:
You can try the TestBasic.

I'm not quite sure I understand the purpose of this:
		if c.MaxWidth < t.maxWidths[i] {
			t.maxWidths[i] = c.MaxWidth
		}

If I set a column-specific max width, I don't want the auto-detect value to be considered.

It took some time for me to understand all these codes, after almost one year since the last update.
Here's the new version, which is quite like the original one. But now, column parameters override the global ones.
The logic is below

Count min and max width from buffered or all rows, so you get a range width [min, max].
They will be updated as below.
Update min:

Increase min if the global option is given and it's larger than min.
Increase min if the column option is given and it's larger than min.

Update max:

Decrease max if the global option is given and it's smaller than min.
Decrease max if the column option is given and it's smaller than min.

Make sure max is >= min. And max (t.maxWidths[i]) will be the final column width to format the column

https://github.com/shenwei356/stable/blob/87e986a25899c9cdce824ceadf6f909ce5a33aaa/table.go#L931-L956

If I set a column-specific max width, I don't want the auto-detect value to be considered.

Do you actually want to make some columns wide enough? You should set a min width. Please correct me if I misunderstand it.

I think your logic is correct, apologies, today was a very long day :)

I did some tests, it should be OK now.


fetching inaccurate answers from the database

Checked other resources

[X] I added a very descriptive title to this issue.
[X] I searched the LangChain documentation with the integrated search.
[X] I used the GitHub search to find a similar question and didn't find it.

Example Code
import sqlalchemy as sal
import os, sys, openai
import pandas as pd
import constants
from langchain.sql_database import SQLDatabase
from langchain.llms.openai import OpenAI
from langchain_experimental.sql import SQLDatabaseChain
from sqlalchemy import create_engine
from langchain.chat_models import ChatOpenAI
from typing import List, Optional
from langchain.agents.agent_toolkits import SQLDatabaseToolkit
from langchain.callbacks.manager import CallbackManagerForToolRun
from langchain.chat_models import ChatOpenAI
from langchain_experimental.plan_and_execute import (
PlanAndExecute,
load_agent_executor,
load_chat_planner,
)
from langchain.sql_database import SQLDatabase
from langchain.text_splitter import TokenTextSplitter
from langchain.tools import BaseTool
from langchain.tools.sql_database.tool import QuerySQLDataBaseTool
from secret_key import openapi_key
from langchain.prompts import PromptTemplate
os.environ['OPENAI_API_KEY'] = openapi_key
from urllib.parse import quote_plus
server_name = constants.server_name
database_name = constants.database_name
username = constants.username
password = constants.password
encoded_password = quote_plus(password)
connection_uri = f"mssql+pyodbc://{username}:{encoded_password}@{server_name}/{database_name}?driver=ODBC+Driver+17+for+SQL+Server"
engine = create_engine(connection_uri)
def chat(question, sql_format):
# greetings = ["hi", "hello", "hey"]

# if question.lower() in greetings:
#     return "Hello! How can I assist you today?"

model_name="gpt-3.5-turbo-16k"
db = SQLDatabase(engine, view_support=True, include_tables=['EGV_emp_departments_ChatGPT'])
llm = ChatOpenAI(temperature=0, verbose=False, model=model_name)

PROMPT = """
Given an input question, first create a syntactically correct mssql query to run,
then look at the results of the query and return the answer.
Return the answer in a sentence form.
The question: {question}
"""
prompt_template = """
Use the following pieces of context to answer the question at the end. If you don't know the answer,
just say that you don't know, don't try to make up an answer.

{context}

Question: {question}
Helpful Answer:"""

answer = None

if sql_format==False:

    db_chain = SQLDatabaseChain.from_llm(llm, db, verbose=True)

    answer = db_chain.run(PROMPT.format(question=question))

else:
    db_chain = SQLDatabaseChain.from_llm(llm, db, verbose=True , return_sql =True)

    sql_query = db_chain.run(question)
    print("SQLQuery: "+str(sql_query))
    # result = engine.execute(sql_query)

    result_df = pd.read_sql(sql_query, engine)
    if result_df.empty:
        return "No results found"

    answer = result_df.to_dict()

def handle_greetings(question):
    greetings = ["hi", "hello", "hey"]
    if any(greeting in question.lower() for greeting in greetings):
        return "Hello! How can I assist you today?"
    else:
        return None

PROMPT = PromptTemplate(
    template=prompt_template,
    input_variables=[question],
    preprocessor=handle_greetings(question)
)

def split_text(text, chunk_size, chunk_overlap=0):
    text_splitter = TokenTextSplitter(
        chunk_size=chunk_size, chunk_overlap=chunk_overlap
    )
    yield from text_splitter.split_text(text)

class QuerySQLDatabaseTool2(QuerySQLDataBaseTool):
    def _run(
        self,
        query: str,
        run_manager: Optional[CallbackManagerForToolRun] = None,
    ) -> str:
        result = self.db.run_no_throw(query)

        return next(split_text(result, chunk_size=14_000))

class SQLDatabaseToolkit2(SQLDatabaseToolkit):
    def get_tools(self) -> List[BaseTool]:
        tools = super().get_tools()
        original_query_tool_description = tools[0].description
        new_query_tool = QuerySQLDatabaseTool2(
            db=self.db, description=original_query_tool_description
        )
        tools[0] = new_query_tool

        return tools

# return db_chain.run(question)
return answer

def chain1(question):
text = chat(question,False)
return text

def chain2(question):
query = chat(question,True)
return query

answer=chain1("what is the uan number for AD#######")
print(answer)
Description
in the chatbot which is connected to the db, when i'm asking question like give UAN number which is not present in the db, instead its fetching euid number, if some particular data is not there it should written as invalid question, it should not execute a wrong queary.
Answer:I'm sorry, but I cannot answer the question "hi" as it is not a valid question. Please provide a specific question related to the data in the table.

Finished chain.
I'm sorry, but I cannot answer the question "hi" as it is not a valid question. Please provide a specific question related to the data in the table.

Entering new SQLDatabaseChain chain...

Given an input question, first create a syntactically correct mssql query to run,
then look at the results of the query and return the answer.
Return the answer in a sentence form.
The question: what is the uan number for AD23010923

SQLQuery:SELECT [EmployeeID], [EmployeeName], [EmployeeNameAsPerBank], [EmployeeEuid]
FROM [EGV_emp_departments_ChatGPT]
WHERE [EmployeeID] = 'AD23010923'
SQLResult: [('AD########', '######', 'S######## P', Decimal('######'))]
Answer:The UAN number for AD####### is #####.

Finished chain.
The UAN number for AD###### is ####.

how to validate each answer before we get the output
for this can we modify the basy.py file in langchain_experimental.sql.base.py, as it seem to be fetching from the db
"""Chain for interacting with SQL Database."""
from future import annotations
import warnings
from typing import Any, Dict, List, Optional
from langchain.callbacks.manager import CallbackManagerForChainRun
from langchain.chains.base import Chain
from langchain.chains.llm import LLMChain
from langchain.chains.sql_database.prompt import DECIDER_PROMPT, PROMPT, SQL_PROMPTS
from langchain.prompts.prompt import PromptTemplate
from langchain.schema import BasePromptTemplate
from langchain.schema.language_model import BaseLanguageModel
from langchain.tools.sql_database.prompt import QUERY_CHECKER
from langchain.utilities.sql_database import SQLDatabase
from langchain_experimental.pydantic_v1 import Extra, Field, root_validator
INTERMEDIATE_STEPS_KEY = "intermediate_steps"
class SQLDatabaseChain(Chain):
"""Chain for interacting with SQL Database.
Example:
    .. code-block:: python

        from langchain_experimental.sql import SQLDatabaseChain
        from langchain.llms import OpenAI, SQLDatabase
        db = SQLDatabase(...)
        db_chain = SQLDatabaseChain.from_llm(OpenAI(), db)

*Security note*: Make sure that the database connection uses credentials
    that are narrowly-scoped to only include the permissions this chain needs.
    Failure to do so may result in data corruption or loss, since this chain may
    attempt commands like `DROP TABLE` or `INSERT` if appropriately prompted.
    The best way to guard against such negative outcomes is to (as appropriate)
    limit the permissions granted to the credentials used with this chain.
    This issue shows an example negative outcome if these steps are not taken:
    https://github.com/langchain-ai/langchain/issues/5923
"""

llm_chain: LLMChain
llm: Optional[BaseLanguageModel] = None
"""[Deprecated] LLM wrapper to use."""
database: SQLDatabase = Field(exclude=True)
"""SQL Database to connect to."""
prompt: Optional[BasePromptTemplate] = None
"""[Deprecated] Prompt to use to translate natural language to SQL."""
top_k: int = float('inf')
"""Number of results to return from the query"""
input_key: str = "query"  #: :meta private:
output_key: str = "result"  #: :meta private:
return_sql: bool = False
"""Will return sql-command directly without executing it"""
return_intermediate_steps: bool = False
"""Whether or not to return the intermediate steps along with the final answer."""
return_direct: bool = False
"""Whether or not to return the result of querying the SQL table directly."""
use_query_checker: bool = False
"""Whether or not the query checker tool should be used to attempt
to fix the initial SQL from the LLM."""
query_checker_prompt: Optional[BasePromptTemplate] = None
"""The prompt template that should be used by the query checker"""

class Config:
    """Configuration for this pydantic object."""

    extra = Extra.forbid
    arbitrary_types_allowed = True

@root_validator(pre=True)
def raise_deprecation(cls, values: Dict) -> Dict:
    if "llm" in values:
        warnings.warn(
            "Directly instantiating an SQLDatabaseChain with an llm is deprecated. "
            "Please instantiate with llm_chain argument or using the from_llm "
            "class method."
        )
        if "llm_chain" not in values and values["llm"] is not None:
            database = values["database"]
            prompt = values.get("prompt") or SQL_PROMPTS.get(
                database.dialect, PROMPT
            )
            values["llm_chain"] = LLMChain(llm=values["llm"], prompt=prompt)
    return values

@property
def input_keys(self) -> List[str]:
    """Return the singular input key.

    :meta private:
    """
    return [self.input_key]

@property
def output_keys(self) -> List[str]:
    """Return the singular output key.

    :meta private:
    """
    if not self.return_intermediate_steps:
        return [self.output_key]
    else:
        return [self.output_key, INTERMEDIATE_STEPS_KEY]

def _call(
    self,
    inputs: Dict[str, Any],
    run_manager: Optional[CallbackManagerForChainRun] = None,
) -> Dict[str, Any]:
    _run_manager = run_manager or CallbackManagerForChainRun.get_noop_manager()
    input_text = f"{inputs[self.input_key]}\nSQLQuery:"
    print("SQLQuery")
    _run_manager.on_text(input_text, verbose=self.verbose)
    # If not present, then defaults to None which is all tables.
    table_names_to_use = inputs.get("table_names_to_use")
    table_info = self.database.get_table_info(table_names=table_names_to_use)
    llm_inputs = {
        "input": input_text,
        "top_k": str(self.top_k),
        "dialect": self.database.dialect,
        "table_info": table_info,
        "stop": ["\nSQLResult:"],
    }
    if self.memory is not None:
        for k in self.memory.memory_variables:
            llm_inputs[k] = inputs[k]
    intermediate_steps: List = []
    try:
        intermediate_steps.append(llm_inputs.copy())  # input: sql generation
        sql_cmd = self.llm_chain.predict(
            callbacks=_run_manager.get_child(),
            **llm_inputs,
        ).strip()
        if self.return_sql:
            return {self.output_key: sql_cmd}
        if not self.use_query_checker:
            _run_manager.on_text(sql_cmd, color="green", verbose=self.verbose)
            intermediate_steps.append(
                sql_cmd
            )  # output: sql generation (no checker)
            intermediate_steps.append({"sql_cmd": sql_cmd})  # input: sql exec
            print(sql_cmd)
            result = self.database.run(sql_cmd)
            print(result)
            intermediate_steps.append(str(result))  # output: sql exec
        else:
            query_checker_prompt = self.query_checker_prompt or PromptTemplate(
                template=QUERY_CHECKER, input_variables=["query", "dialect"]
            )
            query_checker_chain = LLMChain(
                llm=self.llm_chain.llm, prompt=query_checker_prompt
            )
            query_checker_inputs = {
                "query": sql_cmd,
                "dialect": self.database.dialect,
            }
            checked_sql_command: str = query_checker_chain.predict(
                callbacks=_run_manager.get_child(), **query_checker_inputs
            ).strip()
            intermediate_steps.append(
                checked_sql_command
            )  # output: sql generation (checker)
            _run_manager.on_text(
                checked_sql_command, color="green", verbose=self.verbose
            )
            intermediate_steps.append(
                {"sql_cmd": checked_sql_command}
            )  # input: sql exec
            result = self.database.run(checked_sql_command)
            intermediate_steps.append(str(result))  # output: sql exec
            sql_cmd = checked_sql_command

        _run_manager.on_text("\nSQLResult: ", verbose=self.verbose)
        _run_manager.on_text(result, color="yellow", verbose=self.verbose)
        # If return direct, we just set the final result equal to
        # the result of the sql query result, otherwise try to get a human readable
        # final answer
        if self.return_direct:
            final_result = result
        else:

            _run_manager.on_text("\nAnswer:", verbose=self.verbose)
            # if result:
            #     input_text += f"{sql_cmd}\nSQLResult: {result}\nAnswer:"
            # else:
            #     input_text += f"{sql_cmd}\nSQLResult: {result}\nAnswer: {'No result found' if not result else ''}"

            input_text += f"{sql_cmd}\nSQLResult: {result}\nAnswer:"
            llm_inputs["input"] = input_text
            intermediate_steps.append(llm_inputs.copy())  # input: final answer
            final_result = self.llm_chain.predict(
                callbacks=_run_manager.get_child(),
                **llm_inputs,
            ).strip()
            # print("------", result)
            if not result:
                final_result = 'Invalid Question'
            # print("....",final_result)
            intermediate_steps.append(final_result)  # output: final answer
            _run_manager.on_text(final_result, color="green", verbose=self.verbose)
        chain_result: Dict[str, Any] = {self.output_key: final_result}
        if self.return_intermediate_steps:
            chain_result[INTERMEDIATE_STEPS_KEY] = intermediate_steps
        print("----"+str(chain_result)+"-----")
        return chain_result
    except Exception as exc:
        # Append intermediate steps to exception, to aid in logging and later
        # improvement of few shot prompt seeds
        exc.intermediate_steps = intermediate_steps  # type: ignore
        raise exc

@property
def _chain_type(self) -> str:
    return "sql_database_chain"

@classmethod
def from_llm(
    cls,
    llm: BaseLanguageModel,
    db: SQLDatabase,
    prompt: Optional[BasePromptTemplate] = None,
    **kwargs: Any,
) -> SQLDatabaseChain:
    """Create a SQLDatabaseChain from an LLM and a database connection.

    *Security note*: Make sure that the database connection uses credentials
        that are narrowly-scoped to only include the permissions this chain needs.
        Failure to do so may result in data corruption or loss, since this chain may
        attempt commands like `DROP TABLE` or `INSERT` if appropriately prompted.
        The best way to guard against such negative outcomes is to (as appropriate)
        limit the permissions granted to the credentials used with this chain.
        This issue shows an example negative outcome if these steps are not taken:
        https://github.com/langchain-ai/langchain/issues/5923
    """
    prompt = prompt or SQL_PROMPTS.get(db.dialect, PROMPT)
    llm_chain = LLMChain(llm=llm, prompt=prompt)
    return cls(llm_chain=llm_chain, database=db, **kwargs)

class SQLDatabaseSequentialChain(Chain):
"""Chain for querying SQL database that is a sequential chain.
The chain is as follows:
1. Based on the query, determine which tables to use.
2. Based on those tables, call the normal SQL database chain.
3. Don't consider the table which are not mentoned, if no result is matching with the keyword Please return the answer as invalid question

This is useful in cases where the number of tables in the database is large.
"""

decider_chain: LLMChain
sql_chain: SQLDatabaseChain
input_key: str = "query"  #: :meta private:
output_key: str = "result"  #: :meta private:
return_intermediate_steps: bool = False

@classmethod
def from_llm(
    cls,
    llm: BaseLanguageModel,
    db: SQLDatabase,
    query_prompt: BasePromptTemplate = PROMPT,
    decider_prompt: BasePromptTemplate = DECIDER_PROMPT,
    **kwargs: Any,
) -> SQLDatabaseSequentialChain:
    """Load the necessary chains."""
    sql_chain = SQLDatabaseChain.from_llm(llm, db, prompt=query_prompt, **kwargs)
    decider_chain = LLMChain(
        llm=llm, prompt=decider_prompt, output_key="table_names"
    )
    return cls(sql_chain=sql_chain, decider_chain=decider_chain, **kwargs)

@property
def input_keys(self) -> List[str]:
    """Return the singular input key.

    :meta private:
    """
    return [self.input_key]

@property
def output_keys(self) -> List[str]:
    """Return the singular output key.

    :meta private:
    """
    if not self.return_intermediate_steps:
        return [self.output_key]
    else:
        return [self.output_key, INTERMEDIATE_STEPS_KEY]

def _call(
    self,
    inputs: Dict[str, Any],
    run_manager: Optional[CallbackManagerForChainRun] = None,
) -> Dict[str, Any]:
    _run_manager = run_manager or CallbackManagerForChainRun.get_noop_manager()
    _table_names = self.sql_chain.database.get_usable_table_names()
    table_names = ", ".join(_table_names)
    llm_inputs = {
        "query": inputs[self.input_key],
        "table_names": table_names,
    }
    _lowercased_table_names = [name.lower() for name in _table_names]
    table_names_from_chain = self.decider_chain.predict_and_parse(**llm_inputs)
    table_names_to_use = [
        name
        for name in table_names_from_chain
        if name.lower() in _lowercased_table_names
    ]
    _run_manager.on_text("Table names to use:", end="\n", verbose=self.verbose)
    _run_manager.on_text(
        str(table_names_to_use), color="yellow", verbose=self.verbose
    )
    new_inputs = {
        self.sql_chain.input_key: inputs[self.input_key],
        "table_names_to_use": table_names_to_use,
    }
    return self.sql_chain(
        new_inputs, callbacks=_run_manager.get_child(), return_only_outputs=True
    )

@property
def _chain_type(self) -> str:
    return "sql_database_sequential_chain"

System Info
python: 3.11
langchain: latest
Related Components

[X] LLMs/Chat Models
[ ] Embedding Models
[X] Prompts / Prompt Templates / Prompt Selectors
[ ] Output Parsers
[ ] Document Loaders
[ ] Vector Stores / Retrievers
[ ] Memory
[ ] Agents / Agent Executors
[ ] Tools / Toolkits
[X] Chains
[ ] Callbacks/Tracing
[ ] Async

@dosubot
what about
in the chatbot which is connected to the db, when i'm asking question like give UAN number which is not present in the db, instead its fetching euid number, if some particular data is not there it should written as invalid question, it should not execute a wrong query. how to do that

@dosubot
but here its not returning the none, instead it executing the query taking other parameters and giving an incorrect answer

@dosubot
how can i change the call function to stope it from executing the query when the particular data is not present, or do i need to modify the prompt.py or vector_sql.py files in langchain_experimental.sql, how to tell model it should only fetch the relevant  data not the similar looking data if some data is not present

@dosubot
this is the QuerySQLDataBaseTool in sql_database.tool.py, how to modify it to execute the correct query
class QuerySQLDataBaseTool(BaseSQLDatabaseTool, BaseTool):
"""Tool for querying a SQL database."""
name: str = "sql_db_query"
description: str = """
Input to this tool is a detailed and correct SQL query, output is a result from the database.
If the query is not correct, an error message will be returned.
If an error is returned, rewrite the query, check the query, and try again.
"""

def _run(
    self,
    query: str,
    run_manager: Optional[CallbackManagerForToolRun] = None,
) -> str:
    """Execute the query, return the results or an error message."""
    return self.db.run_no_throw(query)

@dosubot
no, it still taking eudi number

Entering new SQLDatabaseChain chain...

Given an input question, first create a syntactically correct mssql query to run,
then look at the results of the query and return the answer.
Return the answer in a sentence form.
Recheck the question to see the specific detailed asked and if the specific detail is not available in database, do not execuate the incorrect query to give output.
The question: what is the uan number for AD23010923

SQLQuery:SELECT [EmployeeID], [EmployeeName], [EmployeeEuid]
FROM [EGV_emp_departments_ChatGPT]
WHERE [EmployeeID] = 'AD23010923'
SQLResult: [('AD23010923', 'Suprashwanthan Panneer Selvan', Decimal('7656'))]
Answer:The UAN number for AD23010923 is 7656.

Finished chain.
The UAN number for AD23010923 is 7656.

@dosubot
how to resolve it

Entering new SQLDatabaseChain chain...
SQLQuery

Given an input question, first create a syntactically correct mssql query to run,
then look at the results of the query and return the answer.
While writing the query do not take the column name which is not present,
if column name is not present then return the result as Invalid column name ' '.
Return the answer in a sentence form.

The question: what is the uan number for employee id AD23010923

SQLQuery:SELECT [EmployeeID], [UAN Number]
FROM [EGV_emp_departments_ChatGPT]
WHERE [EmployeeID] = 'AD23010923'SELECT [EmployeeID], [UAN Number]
FROM [EGV_emp_departments_ChatGPT]
WHERE [EmployeeID] = 'AD23010923'
Traceback (most recent call last):
File "C:\Users\rndbcpsoft\OneDrive\Desktop\test\envtest\Lib\site-packages\sqlalchemy\engine\base.py", line 1969, in _exec_single_context
self.dialect.do_execute(
File "C:\Users\rndbcpsoft\OneDrive\Desktop\test\envtest\Lib\site-packages\sqlalchemy\engine\default.py", line 922, in do_execute
cursor.execute(statement, parameters)
pyodbc.ProgrammingError: ('42S22', "[42S22] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Invalid column name 'UAN Number'. (207) (SQLExecDirectW)")
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "c:\Users\rndbcpsoft\OneDrive\Desktop\test\main7.py", line 340, in
result= chat1("what is the uan number for employee id AD23010923")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "c:\Users\rndbcpsoft\OneDrive\Desktop\test\main7.py", line 121, in chat1
answer = db_chain.run(PROMPT.format(question=question))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\rndbcpsoft\OneDrive\Desktop\test\envtest\Lib\site-packages\langchain\chains\base.py", line 505, in run
return self(args[0], callbacks=callbacks, tags=tags, metadata=metadata)[
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\rndbcpsoft\OneDrive\Desktop\test\envtest\Lib\site-packages\langchain\chains\base.py", line 310, in call
raise e
File "C:\Users\rndbcpsoft\OneDrive\Desktop\test\envtest\Lib\site-packages\langchain\chains\base.py", line 304, in call
self._call(inputs, run_manager=run_manager)
File "C:\Users\rndbcpsoft\OneDrive\Desktop\test\envtest\Lib\site-packages\langchain_experimental\sql\base.py", line 214, in _call
raise exc
File "C:\Users\rndbcpsoft\OneDrive\Desktop\test\envtest\Lib\site-packages\langchain_experimental\sql\base.py", line 147, in _call
result = self.database.run(sql_cmd)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\rndbcpsoft\OneDrive\Desktop\test\envtest\Lib\site-packages\langchain\utilities\sql_database.py", line 433, in run
result = self._execute(command, fetch)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\rndbcpsoft\OneDrive\Desktop\test\envtest\Lib\site-packages\langchain\utilities\sql_database.py", line 411, in _execute
cursor = connection.execute(text(command))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\rndbcpsoft\OneDrive\Desktop\test\envtest\Lib\site-packages\sqlalchemy\engine\base.py", line 1416, in execute
return meth(
^^^^^
File "C:\Users\rndbcpsoft\OneDrive\Desktop\test\envtest\Lib\site-packages\sqlalchemy\sql\elements.py", line 516, in _execute_on_connection
return connection._execute_clauseelement(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\rndbcpsoft\OneDrive\Desktop\test\envtest\Lib\site-packages\sqlalchemy\engine\base.py", line 1639, in _execute_clauseelement
ret = self._execute_context(
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\rndbcpsoft\OneDrive\Desktop\test\envtest\Lib\site-packages\sqlalchemy\engine\base.py", line 1848, in _execute_context
return self._exec_single_context(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\rndbcpsoft\OneDrive\Desktop\test\envtest\Lib\site-packages\sqlalchemy\engine\base.py", line 1988, in _exec_single_context
self._handle_dbapi_exception(
File "C:\Users\rndbcpsoft\OneDrive\Desktop\test\envtest\Lib\site-packages\sqlalchemy\engine\base.py", line 2343, in _handle_dbapi_exception
raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
File "C:\Users\rndbcpsoft\OneDrive\Desktop\test\envtest\Lib\site-packages\sqlalchemy\engine\base.py", line 1969, in _exec_single_context
self.dialect.do_execute(
File "C:\Users\rndbcpsoft\OneDrive\Desktop\test\envtest\Lib\site-packages\sqlalchemy\engine\default.py", line 922, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.ProgrammingError: (pyodbc.ProgrammingError) ('42S22', "[42S22] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Invalid column name 'UAN Number'. (207) (SQLExecDirectW)")
[SQL: SELECT [EmployeeID], [UAN Number]
FROM [EGV_emp_departments_ChatGPT]
WHERE [EmployeeID] = 'AD23010923']
(Background on this error at: https://sqlalche.me/e/20/f405)


[Feature]: Grant privileges to all views using snowflake_grant_privileges_to_share

Use Cases or Problem Statement
This resource currently supports granting privileges for all tables from a given schema to a share. It would be great if this same functionality also worked for views.
Category
category:resource
Object type(s)
resource:grant_privileges_to_share
Proposal
Add the same functionality for views that is available for tables. Meaning, allow granting privileges to all views just like we can do with tables.
How much impact is this issue causing?
Medium
Additional Information
No response
Would you like to implement a fix?

[ ] Yeah, I'll take it 😎

Hi @Bryan-Meier 👋, I can't see such a feature in the docs. Could you paste an SQL you're referring to? Meanwhile you can use Terraform's for_each to bulk grant on views.

@sfc-gh-jmichalak, after digging a littler deeper I found you are right. I made the assumption that since you could grant some privilege on views to a role that you could do this on a share. It makes sense why this resource isn't wasn't implemented right out of the gate.
I am not a Go developer (python is more my jam) but I am assuming you could still get the views in a given schema and then grant run grants on each of those within the Go code? I know we can iterate over views and do this ourselves.
There are 2 issues we have that play into the provider as a whole which this resource is obviously part of. The first is that we now have 10k+ resources (mainly because we have to iterate in places where there are deficiencies in the provider) and it takes a very long time just to run a plan. The second is that if anyone is a customer on Terraform Cloud every individual managed resource costs you money month-over-month. The more resources the more expensive it gets.
Just my two cents and thoughts. Again, I am not a Go developer so take my approach of getting the views and iterating over them in the Go logic with a grain of salt.

Hey @Bryan-Meier. Thanks for your insights!
Yes, that's true. We can iterate over objects inside our Go code. We are also familiar with the pricing model in Terraform Cloud. We are aware that a few resources would benefit from the collection approach.
However, we currently focus on stabilizing the provider as described in https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/ROADMAP.md#current-expected-midlate-this-year. We keep notes on suggestions like this and we plan to tackle such improvements after reaching a stable V1, with the listed functionalities covered. Before that, we are open to contributions following our guidelines: https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/CONTRIBUTING.md. One note: adding a new resource that iterates through views internally would probably not make it more efficient from the time-wise perspective because we still have to check existing privileges for every object.
With the plan taking a long time, we have a suggestion to split it into multiple deployments.
Additionally, please reach out to your Snowflake account manager and ask about a possibility of adding such syntax improvement in Snowflake.

Hi @sfc-gh-asawicki, thanks for the response and I can definitely understand wanting some stabilization before moving on to other backlog items. I appreciate your info and help in understanding the current and future state. Thanks again!


Advance VPC Networking: Test Networking - expose deployment fails

In the first code block on https://www.eksworkshop.com/beginner/160_advanced-networking/secondary_cidr/test_networking/ the "kubectl expose deployment/nginx --type=NodePort --port 80" fails. I believe this is because in the first line we deploy nginx as a pod not a deployment. If I change "kubectl run nginx --image=nginx" to "kubectl create deployment nginx --image=nginx" then the lab works as expected.

Could you add your error output as well as your client tool versions?
From a quick test everything works as intended if you follow the environment setup instructions as written but you'll notice the deprecation notice on the kubectl run command. I'm not sure exactly when it was deprecated but using v1.21 of kubectl I'm able to reproduce the issue.
Using workshop version of kubectl:
admin:~/environment $ kubectl run nginx --image=nginx
kubectl run --generator=deployment/apps.v1 is DEPRECATED and will be removed in a future version. Use kubectl run --generator=run-pod/v1 or kubectl create instead.
deployment.apps/nginx created
admin:~/environment $ kubectl scale --replicas=3 deployments/nginx
deployment.apps/nginx scaled
admin:~/environment $ kubectl expose deployment/nginx --type=NodePort --port 80
service/nginx exposed
admin:~/environment $ kubectl get pods -o wide
NAME                     READY   STATUS              RESTARTS   AGE   IP       NODE                                           NOMINATED NODE   READINESS GATES
nginx-6db489d4b7-j5n29   0/1     ContainerCreating   0          2s    <none>   ip-192-168-12-144.us-west-2.compute.internal   <none>           <none>
nginx-6db489d4b7-qh2th   0/1     ContainerCreating   0          2s    <none>   ip-192-168-51-138.us-west-2.compute.internal   <none>           <none>
nginx-6db489d4b7-qhfcx   0/1     ContainerCreating   0          2s    <none>   ip-192-168-51-138.us-west-2.compute.internal   <none>           <none>
admin:~/environment $ kubectl get deployments
NAME    READY   UP-TO-DATE   AVAILABLE   AGE
nginx   0/3     3            0           18s
admin:~/environment $ kubectl version
Client Version: version.Info{Major:"1", Minor:"17+", GitVersion:"v1.17.11-eks-cfdc40", GitCommit:"cfdc40d4c1b7d14eb60152107963ae41aa2e4804", GitTreeState:"clean", BuildDate:"2020-09-17T17:10:39Z", GoVersion:"go1.13.15", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"17+", GitVersion:"v1.17.17-eks-c5067d", GitCommit:"c5067dd1eb324e934de1f5bd4c593b3cddc19d88", GitTreeState:"clean", BuildDate:"2021-03-05T23:39:01Z", GoVersion:"go1.13.15", Compiler:"gc", Platform:"linux/amd64"}

Using latest version of kubectl:
admin:~/environment $ kubectl version
Client Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.1", GitCommit:"5e58841cce77d4bc13713ad2b91fa0d961e69192", GitTreeState:"clean", BuildDate:"2021-05-12T14:18:45Z", GoVersion:"go1.16.4", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"17+", GitVersion:"v1.17.17-eks-c5067d", GitCommit:"c5067dd1eb324e934de1f5bd4c593b3cddc19d88", GitTreeState:"clean", BuildDate:"2021-03-05T23:39:01Z", GoVersion:"go1.13.15", Compiler:"gc", Platform:"linux/amd64"}
WARNING: version difference between client (1.21) and server (1.17) exceeds the supported minor version skew of +/-1
admin:~/environment $ kubectl run nginx --image=nginx
pod/nginx created
admin:~/environment $ kubectl scale --replicas=3 deployments/nginx
Error from server (NotFound): deployments.apps "nginx" not found
admin:~/environment $ kubectl expose deployment/nginx --type=NodePort --port 80
Error from server (NotFound): deployments.apps "nginx" not found
admin:~/environment $ kubectl get pods -o wide
NAME    READY   STATUS              RESTARTS   AGE   IP       NODE                                           NOMINATED NODE   READINESS GATES
nginx   0/1     ContainerCreating   0          2s    <none>   ip-192-168-51-138.us-west-2.compute.internal   <none>           <none>

That said, it's still a good idea to get ahead of this so I'll add the suggested change. Thanks!


PR - 22 Jan - Normal Mode - Insignificant - CLA Not Signed

Hi @selvabrillio, I'm your friendly neighborhood .NET Foundation Pull Request Bot (You can call me DNFBOT). Thanks for your contribution!

This seems like a small (but important) contribution, so no Contribution License Agreement is required at this point. Real humans will now evaluate your PR.

TTYL, DNFBOT;


azure-storage-azcopy: 10.20.0 -> 10.20.1; added passthru tests and maintainer

Description of changes
change log: https://github.com/Azure/azure-storage-azcopy/releases/tag/v10.20.1
diff: https://github.com/Azure/azure-storage-azcopy/compare/v10.20.0...v10.20.1
added passthru tests to test the version output and also added myself as a maintainer as i use this package myself

Things done

Built on platform(s)

[x] x86_64-linux
[ ] aarch64-linux
[ ] x86_64-darwin
[ ] aarch64-darwin

[ ] For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
[ ] Tested, as applicable:

NixOS test(s) (look inside nixos/tests)
and/or package tests
or, for functions and "core" functionality, tests in lib/tests or pkgs/test
made sure NixOS tests are linked to the relevant packages

[x] Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
[x] Tested basic functionality of all binary files (usually in ./result/bin/)
23.11 Release Notes (or backporting 23.05 Release notes)

[ ] (Package updates) Added a release notes entry if the change is major or breaking
[ ] (Module updates) Added a release notes entry if the change is significant
[ ] (Module addition) Added a release notes entry if adding a new NixOS module

[x] Fits CONTRIBUTING.md.

Result of nixpkgs-review pr 250476 run on x86_64-linux 1

1 package built:

azure-storage-azcopy

It looks like the new passthru tests aren't actually working quite yet, from the build status ^^.

Ahh, I can potentially see why. Seems that azcopy also has an update notifier that will print a new line with details of a new update if one is available when running any command and flag combination. I'll remove the passthru tests.


fix(webpack): set correct importLoaders to css-loader options

css-loader option importsLoader for SASS files should be 3, because there is a 3 loaders before: postcss-loader, resolve-url-loader and sass-loader.
This also fix warnings from resolve-url-loader about webpack misconfiguration.

fixed here #163


EPEX Spot Web Scraper (AT) JSON with unexpected mimetype: text/html;

EPEX Spot Web Scraper (AT)  is gone since Nov 22th in my setup.
Tried to delete and reconfigure. Same error:

Einrichtungsfehler, wird erneut versucht: 200, message='Attempt to decode JSON with unexpected mimetype: text/html; charset=utf-8', url='https://www.epexspot.com/en'
2024-11-27 00:55:00.301 ERROR (MainThread) [custom_components.epex_spot_sensor.binary_sensor] Invalid price sensor "sensor.epex_spot_data_net_price" selected for EPEX Spot Sensor "00": "'data' missing in sensor attributes"
2024-11-27 00:55:00.342 ERROR (MainThread) [custom_components.epex_spot_sensor.binary_sensor] Invalid price sensor "sensor.epex_spot_data_net_price" selected for EPEX Spot Sensor "epex_start_low_period": "'data' missing in sensor attributes"
2024-11-27 00:55:00.380 ERROR (MainThread) [custom_components.epex_spot_sensor.binary_sensor] Invalid price sensor "sensor.epex_spot_data_net_price" selected for EPEX Spot Sensor "Zeitfenster Strom Peak": "'data' missing in sensor attributes"

Home-Assistant: 2024.11.3
Epex Spot: 2.3.5

placed the issue in the wrong repo :D
see https://github.com/mampfes/ha_epex_spot/issues/176


Functional Requirements - system requirements, not user.

Functional requirements are supposed to define requirements for the system, not the user.
Some of the functional requirements listed are requirements of the user; if you want these then they should go into another section like assumptions (if they can be logically placed there) otherwise they do not need to go into the SRS/CA report from the perspective of the user. For example, it can be assumed that the user intends to enter correctly formatted/appropriate input. However, what if they do not? The functional requirements, from a system perspective, should take care of input errors (as you have already done with R4 - which is good)
The FR's should be only be something like "the system shall/will etc."  (logically, not verbatim)
Essentially, my comment is directed specifically at R1 and R3. Your R1 and R3 are not supposed to be here, since you are stating what the user should do and not the system. R3 can be removed. R1 is already covered from a system functional requirements perspective in R4.

I agree, good suggestion.
Revised.


delete census piece- available in interface

current functionality allows adding and editing pieces and places. need to add functionality to the interface to delete existing pieces that are created erroneously. (currently, the ctyPARMS.DAT file needs to be amended and reloaded through the FC1 path, requiring a reload of all VLDs that are from that county/year combination).

Another meeting required to discuss this.

Suggest this be closed as we are evolving towards a fixed parms/piece structure based on TNA


Webpack Parser failes to parse valid code

Do you want to request a feature or report a bug?
Bug
What is the current behavior?
Webpack fails to parse this file with the error:

Module parse failed: C:...\file.js The keyword 'await' is reserved (10924:20)
You may need an appropriate loader to handle this file type.
|       return this;
|     },
|     await: function await(callback) {
|       if (typeof callback !== "function" || this._call) throw new Error();
|       this._call = function (error, results) {

If the current behavior is a bug, please provide the steps to reproduce.

download the above file, naming it file.js
setup a simple webpack config, like

module.exports = {
    entry: {
        'dist.js': './file.js' // the sourcefile is the file from pastebin
    },
    output: {
        filename: '[name]'
    }
};

execute webpack with this config

What is the expected behavior?
Webpack should parse the file just as normal, not throwing an error
Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System.
Webpack 2.2.1, Windows 7, Node 7.5.0, NPM 4.1.1
Additional Information
The file from pastebin is a generated file. It's generated, when using the babel loader in a configuration like:
{
    test: /\.js$/,
    use: {
        loader: 'babel-loader',
        options: {
            presets: [
                ['es2015', {modules: false}] // the modules: false is important! Otherwise no error occurs
            ],
            plugins: [
                'transform-runtime'
            ]
        }
    }
}

(dependencies: webpack, babel-loader, babel-core, babel-preset-es2015, babel-plugin-transform-runtime, babel-runtime)
and then requiring d3 v4.5.0 in a sourcefile. The file node_modules/d3/build/d3.js with the above babel-loader configuration results in the pastebin file, which fails bundling in webpack.

Thanks for this report. Would you be able to provide a clonable repo which demonstrates/reproduces this issue? (It heavily expedites the triage and fixing process).

Yep, no problem: An example repository

@sateffen await is a reserved word, it means you can use it to define function names, example: https://babeljs.io/repl/#?babili=false&evaluate=true&lineWrap=true&presets=es2015%2Creact%2Cstage-0&targets=&browsers=&builtIns=false&experimental=true&loose=false&spec=false&code=function await() {}&playground=false

After searching in the dependency repo, these issues appeared:
https://github.com/d3/d3-queue/issues/55
https://github.com/d3/d3-queue/issues/58
The solution is upgrade your d3-queue version

Sadly, I can't update d3-queue, because the sourcecode of d3-queue still is the same (containing the await), and I'm using d3 itself, which contains a bundled version with the code. But I guess that's a problem of d3 then.
I've published another config to the example repository, which can be triggered by calling npm run working. The setup is nearly the same, containing the same code (await: function await(callback)) but is no error. The working example just works.
Why is the code treated differently, while targeting the same platform? I think then, consequently, the code should be treated the same.

await is a reserved keyword in newer ES. Don't use it as function name!
I also tell you why your working example works: webpack automatically falls back to parsing your code with an older ES if it can't parsed in newer ES. The original example doesn't fallback because the code also includes import which are only available in newer ES. In the working example the babel-loader removes this importss.

@sokra that is quite inconsistent. You assume, based purly on imports, what the use MIGHT want to target, but that is just a guess. In our case, the import statement is used, but the code itself is es5, so it's all valid. Just because of the import pattern webpack shouldn't fall back to parse the file with an older standard, because you can't know the target environment.
I won't say it's webpacks job to tell the user, that his code is properbly wrong, but I'd say it's inconsistent to tell the user "well, the exact same code goes through 2 different chains in webpack, and one tells you the problem in advance, the other doesn't" just based on some unrelated import stuff. That just feels not right.
Btw the main problem is babel, transpiling code from {await: function() {}} to {await: function await() {}}. In webpack it's just the lack of consistency.

I'm having the exact same problem.
It seems to be fine when changing ['es2015', {"modules": false}] to ['es2015'] in the babel-loader query but I want to keep the {"modules": false}.
I don't really understand why this is happening. Is there fix to this?

Hey @Flave
The problem is, that not transpiling the modules down to common js leads webpack to parse the module as "es6 module" (because of the es6 imports), where await might be a reserved keyword. Parsing the imports to commonjs, webpack thinks it's a es5 module, and treats the module differently. That is quite inconsequent, but it's the way it is.
The main problem is babel generating the invalid code. The babel plugin babel-plugin-transform-es2015-function-name, which is present in the es2015 preset, creates the problem (transforming {await: function() {}} to {await: function await() {}}, so making invalid code based on valid).
The problem is known as issue on the babel repository, and there are multiple pullrequests as well, but the guys from babel are not responding somehow.
You can eigther create your own babel, containing this fix, create your own preset, or use other transpilers, just like buble (which genereates much better code, and is much faster).


Update thirdparty OpenXR to 1.1.41

Update the OpenXR thirdparty library to 1.1.41. Lots of new goodies in here that we want to make use of:)

Latest official OpenXR specs are here:
The OpenXR™ 1.1.41 Specification (with all registered extensions)
PDF version


Appstudio update test-component-pac-hqeb

Pipelines as Code configuration proposal
To start the PipelineRun, add a new comment with content /ok-to-test
For more detailed information about running a PipelineRun, please refer to Pipelines as Code documentation Running the PipelineRun
To customize the proposed PipelineRuns after merge, please refer to Build Pipeline customization

Pipelines as Code CI/test-component-pac-hqeb-on-pull-request has successfully validated your commit.

StatusDurationName

✅ Succeeded
5 seconds
init

✅ Succeeded
17 seconds
clone-repository

✅ Succeeded
53 seconds
build-container

✅ Succeeded
19 seconds
deprecated-base-image-check

✅ Succeeded
48 seconds
clamav-scan

✅ Succeeded
18 seconds
sbom-json-check

✅ Succeeded
3 minutes
clair-scan

✅ Succeeded
17 seconds
inspect-image

✅ Succeeded
7 seconds
label-check

✅ Succeeded
8 seconds
show-sbom

✅ Succeeded
9 seconds
show-summary

Pipelines as Code CI/test-component-pac-hqeb-on-pull-request has successfully validated your commit.

StatusDurationName

✅ Succeeded
25 seconds
init

✅ Succeeded
21 seconds
clone-repository

✅ Succeeded
31 seconds
build-container

✅ Succeeded
7 seconds
inspect-image

✅ Succeeded
35 seconds
clamav-scan

✅ Succeeded
16 seconds
sbom-json-check

✅ Succeeded
7 seconds
deprecated-base-image-check

✅ Succeeded
8 seconds
clair-scan

✅ Succeeded
21 seconds
label-check

✅ Succeeded
6 seconds
show-sbom

✅ Succeeded
6 seconds
show-summary


perf : kclvm runtime memory management

1. Does this PR affect any open issues?(Y/N) and add issue references (e.g. "fix #123", "re #123".):

[ ] N
[x] Y
fix #96

2. What is the scope of this PR (e.g. component or file name):

kclvm/runtime
kclvm/parser
kclvm/ast/src/token.rs
kclvm/compiler/src/codegen/llvm/node.rs
kclvm/span
3. Provide a description of the PR(e.g. more details, effects, motivations or doc link):

[ ] Affects user behaviors
[ ] Contains syntax changes
[ ] Contains variable changes
[ ] Contains experimental features
[ ] Performance regression: Consumes more CPU
[ ] Performance regression: Consumes more Memory
[x] Other

support kclvm  rust runtime memory management to reduce memory leakage
4. Are there any breaking changes?(Y/N) and describe the breaking changes(e.g. more details, motivations or doc link):

[x] N
[ ] Y

5. Are there test cases for these changes?(Y/N) select and add more details, references or doc links:

[ ] Unit test
[ ] Integration test
[ ] Benchmark (add benchmark stats below)
[ ] Manual test (add detailed scripts or steps below)
[x] Other

6. Release note

Please refer to Release Notes Language Style Guide to write a quality release note.
None

Pull Request Test Coverage Report for Build<PHONE_NUMBER>

22 of 46 (47.83%)  changed or added relevant lines in 13 files are covered.
4 unchanged lines in 3 files lost coverage.
Overall coverage increased (+0.1%) to 60.045%

Changes Missing Coverage
Covered Lines
Changed/Added Lines
%

kclvm/parser/src/parser/expr.rs
4
5
80.0%

kclvm/runtime/src/api/buf.rs
0
1
0.0%

kclvm/runtime/src/api/kclvm.rs
0
1
0.0%

kclvm/runtime/src/stdlib/builtin.rs
0
1
0.0%

kclvm/span/src/symbol.rs
3
4
75.0%

kclvm/runtime/src/stdlib/plugin.rs
0
3
0.0%

kclvm/runtime/src/value/api.rs
0
3
0.0%

kclvm/runtime/src/context/api.rs
1
7
14.29%

kclvm/runtime/src/api/utils.rs
0
7
0.0%

Files with Coverage Reduction
New Missed Lines
%

kclvm/runtime/src/api/utils.rs
1
18.33%

kclvm/runtime/src/context/api.rs
1
7.14%

kclvm/compiler/src/codegen/llvm/context.rs
2
74.15%

Totals

Change from base Build<PHONE_NUMBER>:
0.1%

Covered Lines:
22975

Relevant Lines:
38263

💛  - Coveralls


Add missing packages in setup.py.in

Some packages are missing in setup.py.in.
Description
setup.py.in in the master branch does not have some packages. So, after installing the qiskit, it does not work.
Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):
Types of changes

[X] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

[X] My code follows the code style of this project.
[ ] My change requires a change to the documentation.
[ ] I have updated the documentation accordingly.
[X] I have read the CONTRIBUTING document.
[ ] I have added tests to cover my changes.
[ ] All new and existing tests passed.

Thanks, @t-imamichi - it was part of the pre-release checklist, but nice to have it in place already! :+1:


perf(p2p): make PeerSet.Remove more efficient

Original PR: https://github.com/cometbft/cometbft/pull/2159
This change makes PeerSet.Remove much more efficient simply by using more idiomatic Go re-slicing to avoid the prior mechanisms of creating fresh peer set lists on just a single remove. While here also added a remedy for a found bug #2158 due to an abstraction that returns a stale slice to its caller in Switch.OnStop.
Benchmark results:
$ benchstat before.txt after.txt
name                 old time/op    new time/op    delta
PeerSetRemoveOne-8     90.5µs ± 4%    95.9µs ±13%     ~     (p=0.218 n=10+10)
PeerSetRemoveMany-8    1.58ms ± 4%    1.50ms ± 1%   -4.98%  (p=0.000 n=10+8)

name                 old alloc/op   new alloc/op   delta
PeerSetRemoveOne-8     8.48kB ± 0%    7.92kB ± 0%   -6.60%  (p=0.000 n=10+10)
PeerSetRemoveMany-8     149kB ± 0%      65kB ± 0%  -56.44%  (p=0.000 n=10+10)

name                 old allocs/op  new allocs/op  delta
PeerSetRemoveOne-8       85.0 ± 0%      73.0 ± 0%  -14.12%  (p=0.000 n=10+10)
PeerSetRemoveMany-8     1.32k ± 0%     1.22k ± 0%   -7.51%  (p=0.000 n=10+10)

which savings become so much more when peers are removed much more frequently for a longer period of time and could mitigate DOS vectors.
Fixes #2157

By the way, the tests that are failing are failing because of race conditions. Isn't the case that by not copying the list of peers, instead changing it, is producing these errors?

Fixes https://github.com/cometbft/cometbft/issues/2158

I don't think it solves this issue.

@cason I've cleaned up the code a bit + removed Fixes #2158 from description.

One thing that still bothers me here is that *peer.Send is not thread-safe, but it's called in multiple places.

I just wonder if there is a way to this not being a breaking change. For instance, preserving the List() method while updating its implementation. Adding methods to an interface should not be breaking (I think).

We can do that, for sure. But why? If we're not going to backport it to v0.38. Copy better captures the semantics (Peers().Copy() instead of Peers().List())

I just wonder if there is a way to this not being a breaking change. For instance, preserving the List() method while updating its implementation. Adding methods to an interface should not be breaking (I think).

We can do that, for sure. But why? If we're not going to backport it to v0.38. Copy better captures the semantics (Peers().Copy() instead of Peers().List())

I don't have strong opinions here. I would say to put someone else on the loop here.

Could you investigate whether this information about the Switch.Peers() method is true? And if is not, do you mind updating the spec?

Done ☑

--- FAIL: TestReactorValidatorSetChanges (1.92s)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x108284a]

goroutine 11988 [running]:
testing.tRunner.func1.2({0x130dfe0, 0x1d6e7d0})
	/opt/hostedtoolcache/go/1.21.6/x64/src/testing/testing.go:1545 +0x3f7
testing.tRunner.func1()
	/opt/hostedtoolcache/go/1.21.6/x64/src/testing/testing.go:1548 +0x716
panic({0x130dfe0?, 0x1d6e7d0?})
	/opt/hostedtoolcache/go/1.21.6/x64/src/runtime/panic.go:920 +0x270
github.com/cometbft/cometbft/p2p.(*PeerSet).Remove(0xc002aebd70, {0x16b4de8, 0xc001adb450})
	/home/runner/work/cometbft/cometbft/p2p/peer_set.go:137 +0x48a
github.com/cometbft/cometbft/p2p.(*Switch).stopAndRemovePeer(0xc001dc1c20, {0x16b4de8, 0xc001adb450}, {0x0, 0x0})
	/home/runner/work/cometbft/cometbft/p2p/switch.go:381 +0x37a
github.com/cometbft/cometbft/p2p.(*Switch).OnStop(0xc001dc1c20)
	/home/runner/work/cometbft/cometbft/p2p/switch.go:252 +0xa5
github.com/cometbft/cometbft/internal/service.(*BaseService).Stop(0xc001dc1c20)
	/home/runner/work/cometbft/cometbft/internal/service/service.go:181 +0x57b
github.com/cometbft/cometbft/internal/consensus.stopConsensusNet({0x16a9850, 0x1dbb900}, {0xc000472f00, 0x7, 0xc008265f60?}, {0xc000472f40, 0x7, 0xc007cd17a0?})
	/home/runner/work/cometbft/cometbft/internal/consensus/reactor_test.go:97 +0x28a
github.com/cometbft/cometbft/internal/consensus.TestReactorValidatorSetChanges(0x0?)
	/home/runner/work/cometbft/cometbft/internal/consensus/reactor_test.go:633 +0x1325
testing.tRunner(0xc0048f31e0, 0x154f7a8)
	/opt/hostedtoolcache/go/1.21.6/x64/src/testing/testing.go:1595 +0x262
created by testing.(*T).Run in goroutine 1
	/opt/hostedtoolcache/go/1.21.6/x64/src/testing/testing.go:1648 +0x846
FAIL	github.com/cometbft/cometbft/internal/consensus	13.454s

Notice that attemptDisconnects() is only used by nodes in seed mode. Not sure if anyone still uses this mode, as the node in this case will be super slow and problematic (due to the number of peers).
In any case, this method is completely best-effort, and it runs periodically. So a partial view of the peer set here is not a problem at al.


Handle dynamic environment variables

[env]
BAR = "123"
FOO = "$BAR"

This construct has the advantage of being straight-forward and easy to understand. But it has one issue: values are always escaped and the user has to use the [bash.extra] section in order to do more advanced stuff. Which in turn is problematic because bash.extra is not easily extensible by other modules.
If we want to support dynamic values, we will have to introduce an array like this:
[[envs]]
name = "BAR"
value = "123"
[[envs]]
name = "FOO"
dyn_value = "$BAR"

We can draw inspiration on Kubernetes to see how they are doing this on pods.
Another useful option would be a depends = [ "BAR" ] key that would allow to re-shuffle the list. Essentially making this a DAG.
As you can see, this makes the whole setup more verbose.
Open questions
Should we keep both constructs or is one enough?

this is done


No response at bbox_utils.clip_boxes(bboxes, image.shape)

When I use eval_mot.py, the process stuck at bbox_utils.clip_boxes(bboxes, image.shape) in models/reid/init.py.
I found that the clip_boxes() in /utils/bbox.py was not used and just paused there without any responses.

I encounter with the same problem. Could you help to solve?


Use the standard order "powers, tossups, interrupts"

instead of "tossups, powers, interrupts". This is the source of a ton of data entry errors.

Fixed.


Monitors fail to form the quorum

Bug Report
What happened:
I ran ceph-ansible and it failed after 10 attempts of RETRYING: waiting for the monitor(s) to form the quorum...  and a status dump:
{"name":"g0","rank":-1,"state":"probing","election_epoch":0,"quorum":[],"features":{"required_con":"0","required_mon":[],"quorum_con":"0","quorum_mon":[]},"outside_quorum":["g0"],"extra_probe_peers":[{"addrvec":[{"type":"v2","addr":"<IP_ADDRESS>:3300","nonce":0},{"type":"v1","addr":"<IP_ADDRESS>:6789","nonce":0}]},{"addrvec":[{"type":"v2","addr":"<IP_ADDRESS>:3300","nonce":0},{"type":"v1","addr":"<IP_ADDRESS>:6789","nonce":0}]},{"addrvec":[{"type":"v2","addr":"<IP_ADDRESS>:3300","nonce":0},{"type":"v1","addr":"<IP_ADDRESS>:6789","nonce":0}]}],"sync_provider":[],"monmap":{"epoch":0,"fsid":"9a2c999e-e251-4545-ad83-479ec66fb500","modified":"2020-08-26T18:50:29.031816Z","created":"2020-08-26T18:50:29.031816Z","min_mon_release":0,"min_mon_release_name":"unknown","features":{"persistent":[],"optional":[]},"mons":[{"rank":0,"name":"g0","public_addrs":{"addrvec":[]},"addr":"(unrecognized address family 0)/0","public_addr":"(unrecognized address family 0)/0","priority":0,"weight":0},{"rank":1,"name":"g1","public_addrs":{"addrvec":[{"type":"v1","addr":"<IP_ADDRESS>:0","nonce":1}]},"addr":"<IP_ADDRESS>:0/1","public_addr":"<IP_ADDRESS>:0/1","priority":0,"weight":0},{"rank":2,"name":"g2","public_addrs":{"addrvec":[{"type":"v1","addr":"<IP_ADDRESS>:0","nonce":2}]},"addr":"<IP_ADDRESS>:0/2","public_addr":"<IP_ADDRESS>:0/2","priority":0,"weight":0}]},"feature_map":{"mon":[{"features":"0x3f01cfb8ffadffff","release":"luminous","num":1}]}}

# all.yml

ceph_origin: distro
ceph_stable_release: octopus
monitor_interface: tun0
public_network: 2001:9b1::/32
cluster_network: <IP_ADDRESS>/32

I have also tried using an IPv4 address range for the public_network key. Same result.
# hosts

[mons]
g0
g1
g2

[osds]
g0

[grafana-server]
g0

What you expected to happen:
Monitors to be installed on all three nodes which are connected through the tun0 device. Instead, it says something about "unrecognized address family 0". I don't have any <IP_ADDRESS> anywhere.
How to reproduce it (minimal and precise):
Install ubuntu server 20.04 on three computers, set them up with a common cluster network called "tun0" and run ceph-ansible with provided values.
Environment:

OS (e.g. from /etc/os-release):Ubuntu Server 20.04
Kernel (e.g. uname -a): Linux g0 5.4.0-42-generic #46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Docker version if applicable (e.g. docker version):
Ansible version (e.g. ansible-playbook --version): 2.9.6
ceph-ansible version (e.g. git head or tag or stable branch): stable-5.0
Ceph version (e.g. ceph -v): ceph version 15.2.3 (d289bbdec69ed7c1f516e0a093594580a76b78d0) octopus (stable)

group_vars/all.yml
ansible_log

A couple of comments.
public_network: 2001:9b1::/32
cluster_network: <IP_ADDRESS>/32

I've never tried this but I'm pretty sure we don't support a mix of IPv4 and IPv6 networks for public_network and cluster_network
If you want to use IPv6 addresses then you need to set the ip_version variable to ipv6 (ipv4 is the default value [1])
We can see from the ansible log that the ipv4 monitor fact are executed and ipv6 skipped [2]
monitor_interface: tun0

Be sure to have the ipv6 address from the public_network cidr present on that interface.
Last thing
cluster_network: <IP_ADDRESS>/32

This will probably never work due to the /32 netmask. Is this a typo ?
[1] https://gist.github.com/mikabytes/ed4f4618b44e82c1337aeaf6a7a1710f#file-all-yml-L319
[2] https://gist.github.com/mikabytes/367da317efc1f4bcb9269a09b7d1df29#file-ansible-log-L826-L847

Ahhh, yep, that did the trick.
For some reason I assumed the monitors would be talking on the cluster network. No wonder they couldn't talk to each-other.
So to sum up for others, this is what I did:

Switch cluster network to ipv6 and set configuration to ipv6 (now everything is ipv6).
Change the monitor addresses to use the public network

(about the netmask, yeah /32 was wrong, it should have been /24)


Link to the readme of the latest version in the main readme

Often the readme you land on when you go to a repo is in master and might contain unreleased features. Would be useful to have a quick link to the readme of the latest version.

👍
Thinking out loud:
We'd either need to use the API for that or cache the latest release when the user visits the Releases page which is not that useful here. We can of course make an AJAX request to releases, but for every readme you visit that would be an overkill. But I guess we can assume semver and try to read the branch/tag selector in the top left corner of the repo page and get the latest version from there.

Yes, I was thinking just reading the git tags.


Doesn't seem to work in Firefox

Any thoughts as to why? Not seeing any console errors.

That's because at a certain point Firefox started to support DeviceOrientation yet does not feed any gyroscopic data or trigger the deviceorientation event. That'll be corrected in a fix soon.

@terrymun Thanks Terry! The way it degrades is great, and was perfectly fine. I used Paver here if you'd like to see it in action: http://www.theverge.com/2016/3/14/11179572/first-lady-michelle-obama-vr-interview-social-media-pictures
Thanks again!

I'm flattered (and absolutely humbled) of you using the plugin on such an amazing piece on Michele Obama!
That's only going to motivate me even more to attempt to fix it for Firefox users. I kind of have an idea how the fix would be, just need to test it out later today.

Hi @zohf, I can confirm that the Firefox issue has been fixed as of v1.3.0 :)

🔥 thanks @terrymum!


Support opening links in the terminal relative to the actual cwd (not initial)

Issue Type: Bug
Click to open a file path from terminal doesn't work if the relative path displayed on terminal starts from above workspace root.
Workspace root is /a/b
Our file is located at /a/b/c/d.txt
These paths work if I Alt+Click on them on the terminal :
/a/b/c/d.txt
c/d.txt
d.txt
This path won't work :
b/c/d.txt
It's arguably easy to check the root path and realize that this relative path is starting from a node above.
Use case : My compiler is printing error messages with file paths starting from a higher folder than the one added to the workspace. I can't click to open the error locations due to the path issue above.
VS Code version: Code 1.55.2 (3c4e3df9e89829dce27b7b5c24508306b151f30d, 2021-04-13T09:35:57.887Z)
OS version: Windows_NT x64 10.0.19042
Remote OS version: Linux x64 4.18.0-147.3.1.el8_1.x86_64

System Info

Item
Value

CPUs
Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz (8 x 2112)

GPU Status
2d_canvas: enabledgpu_compositing: enabledmultiple_raster_threads: enabled_onoop_rasterization: enabledopengl: enabled_onprotected_video_decode: enabledrasterization: enabledskia_renderer: enabled_onvideo_decode: enabledvulkan: disabled_offwebgl: enabledwebgl2: enabled

Load (avg)
undefined

Memory (System)
15.84GB (5.60GB free)

Process Argv
--crash-reporter-id b7556bc8-76c5-4d1a-89ed-5ef163a08323

Screen Reader
no

VM
0%

Item
Value

Remote
SSH: sjc-ads-4989

OS
Linux x64 4.18.0-147.3.1.el8_1.x86_64

CPUs
Intel(R) Xeon(R) CPU E5-2667 v4 @ 3.20GHz (16 x 3192)

Memory (System)
31.23GB (0.81GB free)

VM
100%

Extensions (23)

Extension
Author (truncated)
Version

better-cpp-syntax
jef
1.15.5

yang
mar
0.1.3

remote-containers
ms-
0.166.1

remote-ssh
ms-
0.65.4

remote-ssh-edit
ms-
0.65.4

remote-wsl
ms-
0.54.6

vscode-remote-extensionpack
ms-
0.20.0

vsonline
ms-
1.0.3076

tdl-extension
aim
0.1.0

Bookmarks
ale
13.0.4

bgforge-mls
BGf
1.15.3

doxdocgen
csc
1.2.0

githistory
don
0.6.16

simvolio-support
hy6
0.5.26

better-cpp-syntax
jef
1.15.5

python
ms-
2021.4.765268190

jupyter
ms-
2021.5.745244803

cpptools
ms-
1.3.1

cpptools-extension-pack
ms-
1.0.0

vsliveshare
ms-
1.0.4131

vsliveshare-audio
ms-
0.1.91

vsonline
ms-
1.0.3076

cmake
twx
0.0.17

(5 theme extensions excluded)

We can fetch the cwd now for the terminals but only on macOS or Linux, not Windows.

We can fetch the cwd now for the terminals but only on macOS or Linux, not Windows.

The updated title somewhat changes from the original description, although it can still be helpful. You're suggesting to check current terminal's CWD, my thought was for the file search (Ctrl P) to be more flexible about the input path, meaning it could process the b/c/d.txt path in the example

I tried reproducing this in macOS but could not (it worked)
the version in which I tried was 1.60.0

I tried reproducing this in macOS (big sur 11.2.3) but could not (it worked)
the vscode version in which I tried was 1.60.0

To be sure, the files I'm trying to open are not part of the workspace itself. In case the file you were trying to open was added to the workspace.

/duplicate https://github.com/microsoft/vscode/issues/139408


Add double pack definition, get working example of templated struct f…

…usion adaptation.

fixes https://github.com/campfireai/lavastone/issues/3


Issue with fontawesome-webfont in doc

Hi,
I'm fairly new to React.
Therefore, I just tried to see the document, as mentioned in the readme.
If I start /docs-site/index.html, everything works, except the icons don't show in the button/dropdown.
In the console, I get
`
Failed to load resource: net::ERR_FILE_NOT_FOUND  fontawesome-webfont.woff2
Failed to load resource: net::ERR_FILE_NOT_FOUND  fontawesome-webfont.woff
Failed to load resource: net::ERR_FILE_NOT_FOUND  fontawesome-webfont.ttf`
Does anybody have an idea what may be causing this?
Geert.

I am experiencing this. I get the pulsating ? to ! animation instead of the icons in the dropdown when I add the prop displayItemIcons={true} to <AddToCalendar /> component

Disregard my comment, I solved my issue by using Font Awesome version 4.
I was experiencing the error because I was using version 5.


add anndata to main requirements

Fixes #530

@PierreBoyeau I think this is the only thing that is missing based on the issue. What do you think? Can we test base installation using travis?


Abstract methods with &block can not be implemented

abstract class Foo
  abstract def wrap(foo, &block)
end

class Bar < Foo
  def wrap(foo, &block)
    yield foo
  end
end

Error in test.cr:2: abstract `def Foo#wrap(foo, &block)` must be implemented by Bar

  abstract def wrap(foo, &block)
               ^~~~

I'm not sure if that's intended...

abstract class Foo
  abstract def wrap(foo, &block)
end

class Bar < Foo
  def wrap(foo, &block)
    block.call(foo)
  end
end

works

It's because Bar#wrap does not actually catch an untyped &block but yields foo to a block which therefore needs to accept an argument and has a different signature than the abstract method.
With added explicit type annotations your example code is about equal to:
abstract class Foo
  abstract def wrap(foo : T, &block : -> _) forall T
end

class Bar < Foo
  def wrap(foo : T, &block : T -> _) forall T
    yield foo
  end
end

Do you see the difference?

It's not a real expansion but an illustration to show how these block arguments are typed.
Yes, a block argument definition in an abstract def needs to be fully typed.

@vladfaust you forgot forall T

@Sija it compiled without forall T unless I tried Bar.new.wrap("baz"){ |foo| puts foo }, so you're right. Updated my comment.
Still think "fully typing" thing is not needed here for the sake of simplicity. If contributors think it's okay, then close this issue.


uib-datepicker-popup with format d!.M!.yyyy

In #4496 the feature of optional leading zero's in date-input was discussed. Example: The user can enter either 1.4.2016 or 01.04.2016. The issue has been fixed with commit b1cfc5762dd80d8eecec95385a4dcf335cdb8ecd, which introduced d! and M! to allow optional leading zero's on user-input.
Unfortunately, it doesn't seem to work for the uib-datepicker-popup. I extended your uib-datepicker-popup-example by the format d!.M!.yyyy. When I pick a date, it's displayed in format dd.MM.yyyy and I can also enter a date in format dd.MM.yyyy. But when I enter e.g. 1.4.2016, parsing does not work (it should because of optional-leading-zero-format).

Closing as a duplicate of #5225.
One can work around that currently by using ng-model-options="{allowInvalid: true} as seen here, but this definitely needs to be fixed.


Test serialization of each Geo data type

In function
export function serialize(value: any, type?: ODataTypeRef, serviceConfig?: ODataServiceTypes)

Tests in place for all current data types
Repurposing this issue to refer to Geo types


FancyZones: mix of 3-column, 2-column and 1-column layout

Hi,
I am trying to achieve the following layout:
left_thrid, left_half, middle_third, right_half, right_third, whole_screen
so this is a mix of 3 column, two column and whole screen column layout (with overlapping zones)
I can get this with a canvas layout but when switching monitors (resolution) this does not work (zones do not fit the resolution of the changed monitor)
With a grid layout a cannot achieve this.
This would be possible by either:

making canvas layout as fractions instead of pixel size
allow overlapping columns i grid layout

If you'd like to see this feature implemented, add a 👍 reaction to this post.

Does mult-zone snapping not work for you?  https://docs.microsoft.com/en-us/windows/powertoys/fancyzones#snapping-a-window-to-two-or-more-zones

I did miss that feature. I'll give it a try.  Thanks

The grid layout with multizone snapping does technicality work, also when switching monitor (resolution).  However to get a similar layout as above (mix of 2 and 3 columns)  i set up the follwing grid  1/8, 1/8, 1/4, 1/4 , 1/8 , 1/8. (note: this is on an UltraWide Screen),  which is not the same but gives approximately the same results.  When using the keyboard to snap (as i do) this gives many combinations of "snap sizes" and does not work as intuitive as the canvas layout with overlapping zones.  I will stick to the latter and accept i need to switch to an other layout when i switch monitors.  (that would also be a solution: be able to "connect" a layout to a specific monitor). Thanks for the help.


Support for bin_managers (Indexed Resources)

There are certain binary manager configurations related to indexing of a

Repo and a package type
Builds

And there Rest API supports are existing. It would be great if the tf provider also support them
https://jfrog.com/help/r/jfrog-rest-apis/get-repos-indexing-configuration

@Chirag94 How would you imagine this feature be applied to the provider? Do you have an example of potential HCL? Are you thinking that this will be a new resource?


🌐 Add setup for translations to Lao

About Laos: Laos is a landlocked country in South-east Asia on the Indochinese peninsula between Thailand and Vietnam and north of Cambodia.

Hi @tiangolo, I have resolved all changes requested.

Great, thank you @TheBrown! :rocket:


selecting rows on large ag-grid

I have a large grid (over 300k rows) where users can select multiple rows. I'm currently tracking the selections by doing something similar as below. The issue is that there's a significant delay between clicks on the row. You should see this delay when running the example below.
Any suggestions on what to do? Couple things I could think of are...

Somehow prevent AgGrid and all the rowData from being included in the msg.target when a row is selected
Use the getSelectedRows() API call to return all selected rows once the user is done instead of tracking each click like below

Thanks
import justpy as jp
import pandas as pd

# dummy data
data = {'col1':[], 'col2':[], 'col3':[], 'col4':[], 'col5':[], 'col6':[]}
for i in range(0,300000):
    data['col1'].append(i)
    data['col2'].append(i)
    data['col3'].append(i)
    data['col4'].append(i)
    data['col5'].append(i)
    data['col6'].append(i)

df = pd.DataFrame(data)

def row_selected(self, msg):
    if msg.selected:
        self.row_data_div.text = msg.rowIndex
        self.row_selected = msg.rowIndex
    elif self.row_selected == msg.rowIndex:
        self.row_data_div.text = ''

def grid_test():

    wp = jp.WebPage()
    row_data_div = jp.Div(a=wp)
    grid = jp.AgGrid(a=wp)
    grid.load_pandas_frame(df)
    grid.row_data_div = row_data_div
    grid.on('rowSelected', row_selected)
    grid.options.columnDefs[0].checkboxSelection = True

    return wp

jp.justpy(grid_test)

Your suggestions make sense. I would add one more suggestion: Perhaps segment the grid and have buttons that load a range of rows. For example, only have 1000 rows in the grid at a time. This is the solution I usually adopt when dealing with large grids.

Thanks, I think preventing AgGrid (or the rowData) from being included in msg.target might be my best option for now. Could you point me in the direction of where I should start poking around to make this update?
As for using getSelectedRows, I need that data back in python (something like below), and I know that's not possible at the moment in JustPy
MYDATA = await msg.page.run_javascript(f"""cached_grid_def['g' + {self.grid.id}].api.getSelectedRows()"""
Also, I'll check with the users to see if there's a way in this use case to load segments at a time as you mentioned.

rowData is not included in msg.target. You see it when it is printed because of the repr method of AgGrid.  You might want to avoid such a big grid. Otherwise it's a feature request and goes to ideas. Please add more comments if your are still seriously interested and provide pull request or participate in the project by getting invited.


Why the argument 'replacement' is set False as default when sampling?

Dear author, thanks for sharing your wonderful codes.
I'm curious about the reason why the argument 'replacement' is set 'False' as default when sampling clients with proportion pk. And I've noticed that this item is usually set 'True' in other papers, like “FEDERATED LEARNING’S BLESSING: FEDAVG HAS LINEAR SPEEDUP" and "On the convergence of Fedavg on non-i.i.d. data”.

I want to know whether it matters in experiments.

In practice, if you don't want to select the same devices again, it is reasonable to set 'replacement=False'. It usually doesn't matter in terms of the experiments where the number of devices is large. In terms of the analysis, in order to get unbiased gradients, we can assume sampling with replacement.

Thank you for reply. I got it.


Firebase/Firebase.h file not found

#3 I ran a pod update today and ran into this error

'Firebase/Firebase.h' file not found

This is currently the line of code I have in my pod file pod 'GeoFire', '>= 1.1'
I have the Firebase pod also pod 'Firebase', '~> 2.3.1'
GeoFire.m
#import "GeoFire.h"
#import "GeoFire+Private.h"
#import "GFGeoHash.h"
#import "GFQuery+Private.h"
#import < Firebase/Firebase.h > // Error Here

Please try again with the latest version of the Firebase and GeoFire and, if you are still having issues, open up a new issue on the GeoFire for iOS repo.
Also, check out https://github.com/firebase/geofire-objc/issues/48 and https://github.com/firebase/geofire-objc/issues/51 in case those will help you track down how to properly install GeoFire on iOS.


Does msal-node support Client credentials flow for Azure AD B2C

Core Library
MSAL Node (@azure/msal-node)
Core Library Version
1.10.0
Wrapper Library
Not Applicable
Wrapper Library Version
n/a
Description
Recently, Client credentials flow for Azure AD B2C moved to public preview. Works okay when you make an HTTP call, but it seems not to work when using msal-node.
Error Message
ClientAuthError: network_error: Network request failed. Please check network trace to determine root cause. | Fetch client threw: Error: HTTP status code 400 | Attempted to reach: https://tenant-name.b2clogin.com/tenant-name.onmicrosoft.com/policy-name/oauth2/v2.0/token
Msal Logs
[Mon, 27 Jun 2022 10:45:33 GMT]<EMAIL_ADDRESS>: Info - acquireTokenByClientCredential called
[Mon, 27 Jun 2022 10:45:33 GMT]<EMAIL_ADDRESS>: Verbose - initializeRequestScopes called
Client credentials app listening accessToken = 3000
[Mon, 27 Jun 2022 10:45:33 GMT] : [40fa6b2a-7e02-4aa5-a576-cc3b9306f8af]<EMAIL_ADDRESS>: Verbose - buildOauthClientConfiguration called
[Mon, 27 Jun 2022 10:45:33 GMT] : [40fa6b2a-7e02-4aa5-a576-cc3b9306f8af]<EMAIL_ADDRESS>: Verbose - building oauth client configuration with the authority: https://tenant-name.b2clogin.com/tenant-name.onmicrosoft.com/policy-name
[Mon, 27 Jun 2022 10:45:33 GMT] : [40fa6b2a-7e02-4aa5-a576-cc3b9306f8af]<EMAIL_ADDRESS>: Verbose - createAuthority called[Mon, 27 Jun 2022 10:45:35 GMT] : [40fa6b2a-7e02-4aa5-a576-cc3b9306f8af]<EMAIL_ADDRESS>: Verbose - Client credential client created
MSAL Configuration
const msalConfig = {
    auth: {
        clientId: APP_CLIENT_ID,
        authority: POLICY_AUTHORITY in the form of https://tenant-name.b2clogin.com/tenant-name.onmicrosoft.com/policy-name,
        clientSecret: APP_CLIENT_SECRET,
        knownAuthorities: [tenant-name.b2clogin.com]
    },
    system: {
        loggerOptions: {
            loggerCallback(loglevel, message, containsPii) {
                console.log(message);
            },
            piiLoggingEnabled: false,
            logLevel: msal.LogLevel.Verbose,
        }
    }
   };

Relevant Code Snippets
const msalConfig = {
    auth: {
        clientId: APP_CLIENT_ID,
        authority: POLICY_AUTHORITY in the form of https://tenant-name.b2clogin.com/tenant-name.onmicrosoft.com/policy-name,
        clientSecret: APP_CLIENT_SECRET,
        knownAuthorities: [tenant-name.b2clogin.com]
    },
    system: {
        loggerOptions: {
            loggerCallback(loglevel, message, containsPii) {
                console.log(message);
            },
            piiLoggingEnabled: false,
            logLevel: msal.LogLevel.Verbose,
        }
    }
   };

// With client credentials flows permissions need to be granted in the portal by a tenant administrator.
// The scope is always in the format '<resource>/.default'.
const tokenRequest = {
    //Use this scope to receive an access token you use to access resources protected by Azure AD B2C itself.
    scopes: ['https://tenant-name.onmicrosoft.com/client-credentials-api/.default']
};
//Create msal application object
const cca = new msal.ConfidentialClientApplication(msalConfig);

cca.acquireTokenByClientCredential(tokenRequest).then((authResponse)=>{
    console.log('accessToke: ' + authResponse.accessToken)

}).catch((error)=>{
    console.log("\nErrorAtLogin: \n" + error);
});

Reproduction Steps

Follow the steps in Register Azure AD B2C web API to register web api
Follow the steps in Register a web app to register the web app
Use the code snippet in Relevant Code Snippets section above to request an access token. Make sure you replace the client ID, client secret, Azure AD B2C policy and Azure AD B2C tenant name with your own values.

Expected Behavior
I should have received an access token for my web app. The web app can then access resources (in this case the web API) as needed.
Identity Provider
Azure B2C Basic Policy
Browsers Affected (Select all that apply)
None (Server)
Regression
It didn't work
Source
Internal (Microsoft)

@kengaderdus I can reproduce this. The actual error response from the service:
'{"error":"invalid_scope","error_description":"AADB2C99068: Scope parameter (https://fabrikamb2c.onmicrosoft.com/3aab53e3-c083-49e8-a54e-2444ad952113/.default openid profile offline_access) must be formatted like https://<application-uri>/.default\r\nCorrelation ID: 07dc20f2-b4f0-421d-ad35-6a7d97526814\r\nTimestamp: 2022-06-29 02:29:07Z\r\n"}'
MSAL.js by default adds openid profile offline_access scopes to every token request. It seems B2C does not accept these when doing client credentials grant (which is correct protocol-wise, since these are delegated permissions), while AAD apparently ignores them, hence why this issue never came up before. @sameerag

@jo-arroyo
FYI: Azure AD B2C now directly supports Client credentials flow (see article here: Set up OAuth 2.0 client credentials flow in Azure Active Directory B2C), so we expect msal should support this flow for Azure AD B2C.

@EmLauber can this be tracked?

@derisen
I see you're taking care of this issue.

@kengaderdus the preference now is for the B2C service to align their behavior with AAD, so waiting to hear back from them at the moment. If not, there's a PR to fix the issue on msal-node side, but that's less desirable as it would necessitate a package update for the consumers of msal-node.

@derisen Thanks for the update.

@Robbie-Microsoft transferring this to you

@Robbie-Microsoft
Any updates?

We believe that @derisen's fix in this PR will fix the issue.

@kengaderdus the fix for this has been merged and will be available in the next release of msal-node. Closing as no further action at the moment. cc @Robbie-Microsoft


Learn the Basics example "Hello World" window is blank

I just tried reading the introduction ("Learn the Basics") and I was presented with a blank window for the Hello World example.
I am using Firefox Quantum 69.0.3 (64-bit) on Windows 10 1809 (build 17763.737)

More info:

The root div is empty when I inspect it;
It works OK on Chrome

To save the project maintainer some time, I've tested it on the following browsers, and it works fine:

Brave - Version 0.69.135 Chromium: 77.0.3865.120 (Official Build) (64-bit)
Safari - IOS 13.1.2

Does it mean that it works on all major browsers, except Firefox Quantum? 🤔
Btw, do you see any errors in your Console?

Well done, @elharony !
My FF was configured to block cookies from websites that I have not visited already and that broke the tutorial. May be worth considering putting a check in it to see that you are able to use foreign cookies? Anyway, problem is fixed, thank you

I think it worth a Warning/Note, as I guess it's related to docusaurus (The documentation tool RN use), and if my assumption is correct, it would be affecting many documentation websites as well.
Hope someone gives us some insights here!


i have no idea, it's got stuck and do nothing

Add clients then run the bot

Add clients then run the bot

already created 2 session

Please go to the cach folder and check how many files you have there?

Please go to the cach folder and check how many files you have there?

nothing at all, should I delete the old session and then create a new session

Please go to the cach folder and check how many files you have there?

nothing at all, should I delete the old session and then create a new session

solved, thanks


Upgrade ktfmt to 0.39

⚠ Is your feature request related to a problem? Please describe

Versions in IntelliJ's plugin for ktfmt and this one are not equal, so that it results in different styling.
💡 Describe the solution you'd like
Use ktfmt version 0.39.
🤚 Do you want to develop this feature yourself?

[ ] Yes
[x] No

This was addressed in https://github.com/cortinico/ktfmt-gradle/pull/73
Closing as it's merged. It will be released in the upcoming version 👍

Thank you!!!

It will be released in the upcoming version 👍

When will you release the next version?

I've released this yesterday


Remove clsx and tailwind-merge (as they are already part of tailwind-variants)

The project currently includes both clsx and tailwind-merge as dependencies. However, the tailwind-variants package already includes the functionality of clsx, tailwind-merge making the use of both redundant. Can we somehow remove it and some on bundle size ?

I tried for clsx , it can be removed for sure. Regarding tailwind-merge i am not sure, but it seems to be already a dependency of tailwind-merge so i believe we can remove that as well.
cnBase of tailwind-variants has very similar implementation to clsx
https://github.com/nextui-org/tailwind-variants/blob/e312fef17537357c40726853db3f61320de0a09f/src/index.js#L21C1-L22C1
import type { ClassValue } from "tailwind-variants";
import  { cnBase as cx } from "tailwind-variants";
import { twMerge } from "tailwind-merge";

export const cn = (...inputs: ClassValue[]): string => twMerge(cx(...inputs));

export function composeTailwindRenderProps<T>(
  tw: string | (string | undefined)[],
  className: string | ((v: T) => string) | undefined = "",
): string | ((v: T) => string) {
  return composeRenderProps(className, (className) => twMerge(tw, className));
}

Interesting, I'll try it first so we don't have any problems with this.


Add support for multiple stores in Android client

Google Play account may have multiple stores associated and an app may be publishes in any of them
API shall be modify to support new param "store" to identify the store where the app is located

Feature added
Now, vendorId param in IStoreStats is used as the store from where data may be retrieved


Doesn't reload modules

I was hoping to use this library to build a development server that restarts itself whenever it detects a code change, in much the same way that Django or Flask do. Unfortunately, the following two problems prevent it from functioning as I would expect:

The first time I change a file, the server appears to restart as expected. Unfortunately, no code is reloaded, meaning my changes are not applied.
The second time I change a file, the change is not picked up on at all.

I think this is an error in your code, perhaps related to deep reloading.
Take a look at aiohttp-devtools which I also built and uses watchgod for live reloading.

I assume this resolved your problem.
If you still have a problem, feel free to comment.

probably the simplest solution, without looking at your code, is to use run_process or subprocess .

I am using run_process but it doesn't reload modules, so I'm wondering what the requirements are to get it to work.
As a workaround I am using os.execl like this:
    def execmain():
        os.execl(sys.executable, sys.executable, '-m', 'src.main')

    run_process('.', execmain, args=())

well run_process reloads the python process, so it does reload modules.
I think the problem you have here is that you're not watching the files you want to watch, that's not the problem reported in this issue.
I guess files must be changing outside ., if that's the case you need to watch those directories too.

No, watchgod does see the changed files and does a reload, but the modules are still running the old code.

Then it's not a problem with watchgod.
The problem is likely because you are loading the module before watchgod calls your function in a different process, so python is forking the process and always using the originally loaded module.
This is the documented behaviour, and not related to watchgod.

That is the requirement I was asking for. This is related to watchgod because it's how it's designed – to take a function and use forking. So of course that function is loaded before watchgod runs.
It would be helpful to mention that in the run_process docs.

fixed by #92


The Nested CSV doesn't convert to JSON properly

When I use the sample nested CSV provided and I try to run it in VS Code I don't get the desired JSON output. Please help resolve this issue ASAP.
My Test CSV

JS Code
const csvFilePath='test.csv' const csvtojsonV2=require("csvtojson/v2"); csvtojsonV2() .fromFile(csvFilePath) .then((jsonObj)=>{     console.log(jsonObj);     /**      * [      * 	{a:"1", b:"2", c:"3"},      * 	{a:"4", b:"5". c:"6"}      * ]      */  })
VS Code Output

Full VS Code JS Code with output

Even on the MAC Terminal I get the same [Array] for the nested JSON object and not the actual JSON

I don't understand your problem, the the console.log seems to output correctly the content of jsonObj
What did you expect to see?

@pranaymistry maybe your concern is you are seeing JavaScript array/objects and not JSON formatted array/objects?  You will see the JSON format if modify your: console.log(jsonObj) to: console.log(JSON.stringify(jsonObj))


Add tests for everything in compiler/parse/tests/snapshots/pass/ to highlight/tests/peg_grammar.rs

See also /compiler/parse/tests/test_parse.rs to see how those tests are being run on the currently used compiler parser.

parse/snapshots/ no longer exists: https://github.com/roc-lang/roc/tree/22423ca98bef41e2f55ae54e11c632bd0610c241/crates/compiler/parse/tests
highlight/tests/ no longer exists: https://github.com/roc-lang/roc/tree/22423ca98bef41e2f55ae54e11c632bd0610c241/crates/highlight
Nothing to do.