primordic/IssueDupesLite huggingface dataset:
Repository: oguimbal/pg-mem

Issue #5: pg-promise and exporting Schemas Automatically
Created: 2020-12-04T07:46:24Z
Context:

I am not using nor do I want to use an ORM
I need an in-memory DB that pulls schemas exported somehow from my real DB and creates the tables

Is there a way for me to:
1) Export my schemas from my postgres DB in a format your library will take and run with that creates the tables automatically for me?
I looked at  your examples but none of them talks about some way to do what I'm saying without using an ORM.
Like does yours do something like sqlite has:
https://sqlite.org/schematab.html

Duplicate issue #6: Error when running Create Table Script
Created: 2020-12-04T07:50:09Z
In pgAdmin I generate a Create Table Script off my table then try to use it with your lib:
const pg = newDb().adapters.createPgPromise();
const client = await pg.connect();
const crafterTable = await client.none(`CREATE TABLE public.crafter
(
    crafter_name_first character varying COLLATE pg_catalog."default" NOT NULL,
    crafter_name_last character varying COLLATE pg_catalog."default" NOT NULL,
)

TABLESPACE pg_default;

ALTER TABLE public.crafter
    OWNER to postgres;

GRANT ALL ON TABLE public.crafter TO postgres;

GRANT SELECT ON TABLE public.crafter TO wedotdd_readonly_crafter_id_fistname_lastname;

GRANT SELECT(crafter_name_first) ON public.crafter TO wedotdd_readonly_crafter_id_fistname_lastname;

GRANT SELECT(crafter_name_last) ON public.crafter TO wedotdd_readonly_crafter_id_fistname_lastname;

GRANT SELECT(crafter_id) ON public.crafter TO wedotdd_readonly_crafter_id_fistname_lastname;`);

but, I end up with errors like this, not sure how to resolve this, or if your lib can handle this at all?:
Error: Syntax error at line 4 col 41:

      crafter_name_last character varying COLLATE
                                          ^
Unexpected kw_collate token: "COLLATE". Instead, I was expecting to see one of the following:


A lparen token based on:
    lparen →  ● %lparen
    data_type$ebnf$1$subexpression$1 →  ● lparen int rparen
    data_type$ebnf$1 →  ● data_type$ebnf$1$subexpression$1
    data_type → data_type_simple ● data_type$ebnf$1 data_type$ebnf$2
    createtable_column → word ● data_type createtable_column$ebnf$1 createtable_column$ebnf$2
    createtable_declaration$subexpression$1 →  ● createtable_column
    createtable_declaration →  ● createtable_declaration$subexpression$1
    createtable_declarationlist$ebnf$1$subexpression$1 → comma ● createtable_declaration
    createtable_declarationlist$ebnf$1 → createtable_declarationlist$ebnf$1 ● createtable_declarationlist$ebnf$1$subexpression$1
    createtable_declarationlist → createtable_declaration ● createtable_declarationlist$ebnf$1
    createtable_statement → %kw_create %kw_table createtable_statement$ebnf$1 word lparen ● createtable_declarationlist rparen
    statement →  ● createtable_statement
    main → main$ebnf$1 ● statement main$ebnf$2 main$ebnf$3

Closing comment (2020-12-04T08:25:30Z): Closed as kind-of-duplicate of #5 :)
Repository: oguimbal/pg-mem

Issue #35: "insert into select" support   (todo: array-mode iteration error)
Created: 2021-01-14T15:57:25Z
This is code express-session appears to use. Support for this would certainly be nice 👍 although it seems a bit complicated. I'm not sure what the point of an inner SELECT query is here since it is not actually looking up values from elsewhere but just providing them directly, but somebody better versed in SQL might know why this is clever.
Error: todo: array-mode iteration
*️⃣ Failed SQL statement: INSERT INTO "express_server_sessions" (sess, expire, sid) SELECT '{"cookie":{"originalMaxAge":1296000000,"expires":"2021-01-29T15:49:27.925Z","secure":true,"httpOnly":true,"path":"/"},"passport":{"user":653646}}', to_timestamp(1611935368), 'jCUSxo0EnzcIeCQYUgt6g3FQCoIO6Q3S' ON CONFLICT (sid) DO UPDATE SET sess='{"cookie":{"originalMaxAge":1296000000,"expires":"2021-01-29T15:49:27.925Z","secure":true,"httpOnly":true,"path":"/"},"passport":{"user":653646}}', expire=to_timestamp(1611935368) RETURNING sid;

PS: to run this code in the first place I had to work around the lack of to_timestamp:
const pgMem = require('pg-mem');
const mockDb = pgMem.newDb();


mockDb.public.registerFunction({
  name: 'to_timestamp',
  args: [pgMem.DataType.integer],
  returns: pgMem.DataType.timestampz,
  implementation: input => {
    return new Date(input * 1000).toISOString();
  },
});

Duplicate issue #45: Cannot run Insert Statement based on Select
Created: 2021-01-22T03:32:15Z
So I can't do Unexpected kw_do token: "do"
And I can't do Support for aggregate function max
And now looking for a way to dumb this down so that pg-mem can actually run some migrations I must be able to run, but I can't run any of these dumbed down statements either:
INSERT INTO community (name,community_id)
select 'Atlanta', location_id from location where name = 'Atlanta, GA';
or
INSERT INTO community (name,community_id) (select 'Atlanta', location_id from location where name = 'Atlanta, GA');
or
INSERT INTO community (name,community_id) ((select 'Atlanta', location_id from location where name = 'Atlanta, GA'));
or
INSERT INTO community (name,community_id)
VALUES ((select 'Alanta' as name), (select 'Atlanta', location_id from location where name = 'Atlanta, GA'));
or
INSERT INTO community (name,community_id) VALUES
(('Atlanta'), (select 'Atlanta', location_id from location where name = 'Atlanta, GA'));
Example error (got this on the first example above) :
Error: todo: array-mode iteration
💥 This is a nasty error, which was unexpected by pg-mem. Also known "a bug" 😁 Please file an issue !

*️⃣ Failed SQL statement: INSERT INTO city (name, state_id)
select 'Atlanta', select 'Atlanta', location_id from location where name = 'Atlanta, GA';

So what do I do now? How can I get this insert working?  This isn't an advanced thang.
I've got to be able to run these at the very least if you don't support PL/pgSQL yet, this is the only alternative I can think of to get my stuff hopefully to continue to work in pg-mem in the dumbest way possible.

Closing comment (2021-01-22T08:44:22Z): Duplicate of #35
Repository: oguimbal/pg-mem

Issue #38: Self-Alias not found  (subquery using alias of its outer query)
Created: 2021-01-18T10:32:15Z
https://oguimbal.github.io/pg-mem-playground/
CREATE TABLE my_table (id text NOT NULL PRIMARY KEY, name text NOT NULL, parent_id text);
CREATE INDEX my_table_idx_name ON my_table (name);
CREATE INDEX my_table_idx_id_parent_id ON my_table (id,parent_id);

SELECT * FROM my_table as t1 WHERE t1.name = 'test';
SELECT * FROM my_table as t1 WHERE t1.name = 'test' AND NOT EXISTS (SELECT * FROM my_table as t2 WHERE t2.parent_id = t1.id);

Alias 't1' not found

🐜 This seems to be an execution error, which means that your request syntax seems okay,
but the resulting statement cannot be executed → Probably not a pg-mem error.

*️⃣ Reconsituted failed SQL statement: SELECT *  FROM "my_table" AS "t1"  WHERE (("t1"."name" = ('test')) AND (NOT ("exists"((SELECT *  FROM "my_table" AS "t2"  WHERE ("t2"."parent_id" = "t1"."id") )))))

👉 You can file an issue at https://github.com/oguimbal/pg-mem along with a way to reproduce this error (if you can), and  the stacktrace:

Duplicate issue #53: Support Typeorm@0.2.30
Created: 2021-02-05T20:01:08Z
QueryFailedError: column "columns.table_name" does not exist

🐜 This seems to be an execution error, which means that your request syntax seems okay,
but the resulting statement cannot be executed → Probably not a pg-mem error.

*️⃣ Failed SQL statement: 
            SELECT columns.*,
              pg_catalog.col_description(('"' || table_catalog || '"."' || table_schema || '"."' || table_name || '"')::regclass::oid, ordinal_position) AS description,
              ('"' || "udt_schema" || '"."' || "udt_name" || '"')::"regtype" AS "regtype",
              pg_catalog.format_type("col_attr"."atttypid", "col_attr"."atttypmod") AS "format_type"
              FROM "information_schema"."columns"
              LEFT JOIN "pg_catalog"."pg_attribute" AS "col_attr"
              ON "col_attr"."attname" = "columns"."column_name"
              AND "col_attr"."attrelid" = (
                SELECT
                  "cls"."oid" FROM "pg_catalog"."pg_class" AS "cls"
                  LEFT JOIN "pg_catalog"."pg_namespace" AS "ns"
                  ON "ns"."oid" = "cls"."relnamespace"
                WHERE "cls"."relname" = "columns"."table_name"
                AND "ns"."nspname" = "columns"."table_schema"
              )
            WHERE
            ("table_schema" = 'public' AND "table_name" = 'account');

see this repro repo, mentioned in comments here

Closing comment (2021-02-05T20:17:39Z): Okay, turns out it is a duplicate of #38
Repository: oguimbal/pg-mem

Issue #26: Support Sequelize : Must implement cross joins (carthesian products)
Created: 2021-01-05T19:37:58Z
Sequelize is generating requests using "comma-join-syntax", which is currently not supported.
👉 Failed query:

    SELECT i.relname AS name, ix.indisprimary AS primary, ix.indisunique AS unique, ix.indkey AS indkey, array_agg(a.attnum) as column_indexes, array_agg(a.attname) AS column_names, pg_get_indexdef(ix.indexrelid) AS definition FROM pg_class t, pg_class i, pg_index ix, pg_attribute a WHERE t.oid = ix.indrelid AND i.oid = ix.indexrelid AND a.attrelid = t.oid AND t.relkind = 'r' and t.relname = 'Users' GROUP BY i.relname, ix.indexrelid, ix.indisprimary, ix.indisunique, ix.indkey ORDER BY i.relname;;

💀 Syntax error at line 1 col 239:

  SELECT i.relname AS name, ix.indisprimary AS primary, ix.indisunique AS unique, ix.indkey AS indkey, array_agg(a.attnum) as column_indexes, array_agg(a.attname) AS column_names, pg_get_indexdef(ix.indexrelid) AS definition FROM pg_class t,
                                                                                                                                                                                                                                                ^
Unexpected comma token: ",". Instead, I was expecting to see one of the following:

This syntax is not supported as of today because it was kind of harder to implement, since it can lead to cross-joins (carthesian products).
=> This must be done.
Unit test stub for sequelize:  src/tests/sequelize-real.spec.ts  (currently ignored)

Duplicate issue #57: Simple query with Multiple Aliases Not Parsing
Created: 2021-02-10T05:44:02Z
For some reason, it can't parse this but this is a valid query:
SELECT c.community_id,
       l.location_id
FROM community c,
     location l
WHERE c.name = 'test'
AND l.name = 'test2';
Error
 '\n' +
      '💀 Syntax error at line 11 col 17:\n' +
      '\n' +
      '  FROM community c,\n' +
      '                  ^\n' +
      'Unexpected comma token: ",". Instead, I was expecting to see one of the following:\n' +
      '\n' +
      '    - A "kw_left" token\n' +
      '    - A "kw_right" token\n' +
      '    - A "kw_full" token\n' +
      '    - A "kw_inner" token\n' +
      '    - A "kw_where" token\n' +
      '    - A "kw_group" token\n' +

Closing comment (2021-02-10T08:13:07Z): Hi, that's a cartesian product, or cross join, which is not yet supported. This is a duplicate of #26 :)
Repository: oguimbal/pg-mem

Issue #137: `pg` adapter leaks symbols in rows
Created: 2021-07-12T11:48:11Z
Hello again,
We noticed that rows being return from pg adapter queries include Symbol(_id).
This is mostly aesthetic, but can be confusing. I'll be happy try a PR, do you have any pointers ?
Best,
// pg-mem/src/tests/pg.spec.ts

it('does not leak symbol properties in rows', async () => {
    simpleDb();
    const { Client } = db.adapters.createPg();
    const client = new Client();
    await client.connect();

    many(`create table mytable (msg varchar);
        insert into mytable values ('hello'), ('hi');`);

    const got = await client.query('select * from mytable;');

    // fails
    expect(Object.getOwnPropertySymbols(got.rows[0]).length).to.be.equal(0);

    await client.end();
});

Duplicate issue #141: pg returns extra two properties symbols in rows
Created: 2021-07-16T05:55:55Z
I'm using pg-mem with knex for testing and I notice it is returning two extra properties Symbol() and Symbol(_id)
What are these properties and how can I remove them, Is there a setting for that?
version: 1.9.11
node: 14.16.0

Closing comment (2021-07-16T11:00:11Z): Hi,
Dupe of #137 :)
Repository: olado/doT

Issue #56: Add support for sourcemaps
Created: 2013-01-02T23:30:27Z
It would be great to add support for source maps for compiled templates.
http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/
This would be cool and will improve debugging of produced javascript.

Duplicate issue #181: Feature request: error with a line number, is it possible?
Created: 2015-11-13T23:50:12Z

Closing comment (2017-02-13T19:57:30Z): actually it's duplicate of #56
Repository: olado/doT

Issue #174: Feature request: allow partial modification of templateSettings
Created: 2015-09-01T10:51:15Z
I just ran into an issue where I was trying to change templateSettings.varname and as  result my templates weren't being compiled. Looking at the code, I realized that by changing only one attribute of the config object, I was wiping out all the others.
Though not crucial, it would be nice to be able to change individual config attributes without having to maintain a copy of all the others, for example in case of an update that adds a new attribute that older user code might not contain.
I had two possiblities I'd considered for doing this, but am unsure if either matches the project's intentions. If either does, I am happy to create PRs. They are:

in doT.template, loop through any attributes in c and overwrite those in templateSettings
add a function to alter templateSettings at the object level before use so it doesn't impact the speed of doT.template

Duplicate issue #202: template compilation settings should overload
Created: 2016-08-28T08:50:28Z
Currently it seems that when custom compiler settings are defined, you are required to specify all settings rather than just the ones you want to overload. This means that you need to copy the existing default dot.templateSettings object before applying your changes only to feed it back into the dot.template function.
This could be my personal opinion but it would be a lot more natural and usable if the object passed to the dot.template function would just overload the defaults for the that specific template.

Closing comment (2016-10-30T20:24:25Z): duplicate of #174
Repository: olado/doT

Issue #133: How fast is do T tempalte comparing C, C++ tempalte engines?
Created: 2014-12-13T16:44:20Z
Hello,
How fast is do T tempalte comparing C, C++ tempalte engines?
I was hesitating with do T and any c c++ template engine for high speed and cpu performance.for my php website.
Would you have any info about that?
I was hesitating using do T  or any of the  c or c++ template engines wich are said to be  the fastest such as those once;
http://alexeyrybak.com/blitz/blitz_en.html or http://en.wikipedia.org/wiki/CTPP for php websites,
http://www.clearsilver.net/
http://teng.sourceforge.net/

Duplicate issue #132: Dot template engin vs c or c++ template engines
Created: 2014-12-11T00:40:48Z
Hello,
I wanted to change my magento tempalte engine with a high speed cpu low resource feature and I am wondering after some research wich one would suit my project,
it is said that Dot template engin is by far the fastest and the best afterr having read the linkedin report here http://engineering.linkedin.com/frontend/client-side-templating-throwdown-mustache-handlebars-dustjs-and-more and from http://garann.github.io/template-chooser/
But I was told that c or c++ template engines are the fastest such as those once
http://alexeyrybak.com/blitz/blitz_en.html or http://en.wikipedia.org/wiki/CTPP for php websites,
could someone advise me and explain me the difference amoung the 3 template engines listed here above?
There is some comparison here on http://en.wikipedia.org/wiki/Comparison_of_web_template_engines
Regards, Heather

Closing comment (2015-02-27T03:17:44Z): duplicate of #133 should be closed
Repository: olado/doT

Issue #76: whitespace removal problem
Created: 2013-03-28T13:36:51Z
Can line 92 be changed to:
str = ("var out='" + (c.strip ? str.replace(/(^|\r|\n)\t* +| +\t*(\r|\n|$)/g,'')
Changing the replacement value to empty string.
In most cases is is unnecessary, but with li tags, space between them on new lines is always present when using new lines to create horizontal lists.
It would be nice if the whitespace stripping could fix this issue as a bonus to compression.

Duplicate issue #107: please don't clear blank
Created: 2013-12-13T02:43:46Z
the html like the:
doT.template('llll<a\t\n\rhref="">blank</a>kkk') + '';
will echo
"function anonymous(it) {
var out='llll<ahref=" ">blank</a>kkk';return out;
}"
the "\t\n\r" will be clear,it is wrong;must be keep they.

Closing comment (2016-10-30T22:23:08Z): duplicate of #76, #177
Repository: olado/doT

Issue #76: whitespace removal problem
Created: 2013-03-28T13:36:51Z
Can line 92 be changed to:
str = ("var out='" + (c.strip ? str.replace(/(^|\r|\n)\t* +| +\t*(\r|\n|$)/g,'')
Changing the replacement value to empty string.
In most cases is is unnecessary, but with li tags, space between them on new lines is always present when using new lines to create horizontal lists.
It would be nice if the whitespace stripping could fix this issue as a bonus to compression.

Duplicate issue #153: Optimization
Created: 2015-04-21T23:02:20Z
line 94 in dot.js:  str = ("var out='" + (c.strip ? str.replace(/(^|\r|\n)\t* +| +\t*(\r|\n|$)/g," ")
can you change the last white space " " to "" ?

Closing comment (2016-10-30T22:51:10Z): @signumcode closing it.
related to #76
Repository: olado/doT

Issue #174: Feature request: allow partial modification of templateSettings
Created: 2015-09-01T10:51:15Z
I just ran into an issue where I was trying to change templateSettings.varname and as  result my templates weren't being compiled. Looking at the code, I realized that by changing only one attribute of the config object, I was wiping out all the others.
Though not crucial, it would be nice to be able to change individual config attributes without having to maintain a copy of all the others, for example in case of an update that adds a new attribute that older user code might not contain.
I had two possiblities I'd considered for doing this, but am unsure if either matches the project's intentions. If either does, I am happy to create PRs. They are:

in doT.template, loop through any attributes in c and overwrite those in templateSettings
add a function to alter templateSettings at the object level before use so it doesn't impact the speed of doT.template

Duplicate issue #243: custom compilation settings behavior
Created: 2017-10-20T10:56:50Z
const doT = require('dot');

const text = "{{=it.foo}}\r\nan other line";
const data = { foo: 'bar' };

var template;

console.log(doT.template(text, {strip: false})(data );
// display "{{=it.foo}}\r\nan other line"

console.log(doT.template(text, {...doT.templateSettings, strip: false})(data );
// display "bar\r\nan other line"
I suggest doT.template() use default settings if property is missing in custom settings.

Closing comment (2017-10-20T19:15:57Z): duplicate of #174
Repository: olado/doT

Issue #255: Is dot.js compatible with IE8?
Created: 2018-01-25T03:30:56Z
I am using the version of jQuery1.9, and it seems that the written template can't be resolved in the magic of IE8. Is there any explanation for IE compatibility?

Duplicate issue #254: dot.js是否兼容IE8浏览器呢？
Created: 2018-01-25T03:29:05Z
我使用的是jQuery1.9的版本，对于写好的模板好像在神奇的IE8下解析不了，有关于IE兼容的说明吗？

Closing comment (2018-06-19T18:51:22Z): Assume it’s duplicate of #255
Repository: olado/doT

Issue #76: whitespace removal problem
Created: 2013-03-28T13:36:51Z
Can line 92 be changed to:
str = ("var out='" + (c.strip ? str.replace(/(^|\r|\n)\t* +| +\t*(\r|\n|$)/g,'')
Changing the replacement value to empty string.
In most cases is is unnecessary, but with li tags, space between them on new lines is always present when using new lines to create horizontal lists.
It would be nice if the whitespace stripping could fix this issue as a bonus to compression.

Duplicate issue #148: if else if else blocks not rendered correctly when brackets are omitted
Created: 2015-03-20T04:11:44Z
Valid js:
if (true && thing)
  return 1;
else if (true && anotherThing) 
  return -1;
else
  return 0;
renders:
elsereturn 0;
should be:
else return 0;

Closing comment (2016-10-30T22:21:23Z): duplicate of #76, #177
Repository: olado/doT

Issue #58: Move dot-packer to a separate npm package
Created: 2013-01-05T16:52:31Z
Shouldn't the packages used in dot-packer be listed as dependencies on package.json?
These are: commander, mkdirp and uglify-js. Now listed as dev dependencies.
"dependencies": {
  "commander": "*",
  "uglify-js": "*",
  "mkdirp": "*"
},
"devDependencies": {
  "mocha": "*",
  "jshint": "*"
}

I couldn't start using dot-packer right away after installing dot via npm.
I had to run 'npm install' on the node_modules/dot folder to get these installed,
but also mocha, jshint which you don't need if you're not developing.

Duplicate issue #86: commander is not a devDependency
Created: 2013-07-05T05:19:03Z
As it's not written dependency attribute, commander will not be installe from NPM. Running dottojs in command line will fail.
https://github.com/olado/doT/blob/master/package.json#L27

Closing comment (2016-10-30T21:08:49Z): duplicate of #58
Repository: olado/doT

Issue #58: Move dot-packer to a separate npm package
Created: 2013-01-05T16:52:31Z
Shouldn't the packages used in dot-packer be listed as dependencies on package.json?
These are: commander, mkdirp and uglify-js. Now listed as dev dependencies.
"dependencies": {
  "commander": "*",
  "uglify-js": "*",
  "mkdirp": "*"
},
"devDependencies": {
  "mocha": "*",
  "jshint": "*"
}

I couldn't start using dot-packer right away after installing dot via npm.
I had to run 'npm install' on the node_modules/dot folder to get these installed,
but also mocha, jshint which you don't need if you're not developing.

Duplicate issue #143: Windows: running dottos.cmd with no arguments gives an error 
Created: 2015-02-12T19:39:05Z
../website>dottojs.cmd

module.js:340
    throw err;
          ^
Error: Cannot find module 'commander'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (C:\Users\...\AppData\Roaming\npm\node_modules\dot\bin\dot-packer:4:15)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)

Closing comment (2016-10-30T23:03:59Z): duplicate of #58
Repository: omry/omegaconf

Issue #91: Consider supporting basic operators in interpolations of numbers
Created: 2019-12-02T16:57:04Z
a: 1
b: 2.0
d: ${a} - ${b}
e: ${a} + ${b}
d: ${a} * ${b}
e: ${a} / ${b}
desired behavior:
conf = OmegaConf.load("file.yaml")
assert conf.d == -1.0
assert conf.d == 3.0
assert conf.d == 2.0
assert conf.d == 0.5
This should work only if both operands are numbers (int or float). result type should be int if both are ints or float otherwise.
EDIT (2022-12-20):
✨✨✨ See the OmegaConf docs on How to Perform Arithmetic Using eval as a Resolver ✨✨✨

Duplicate issue #437: Perform mathematical operations with interpolated variables.
Created: 2020-11-09T20:44:25Z
idea
I would like to perform math operations that involve more than one interpolated (probably unresolved) numerical variable, when using structured configurations.
Considering the following example :
imports
from typing import Any, Optional

from dataclasses import dataclass
from omegaconf import OmegaConf, MISSING, II
dataclasses
@dataclass
class R:
    p: int = MISSING
    q: int = MISSING

@dataclass
class S:
    a: int = MISSING
    b: int = MISSING
    c: int = MISSING

@dataclass
class T:
    r: R = MISSING
    s: S = MISSING
example
I'd like to do something like the following :
rho: float = 0.5

t = T(
    r=R(
        p=128,
        q=100
    ),
    s=S(
        a = II("r.p") - II("r.q"),
        b = - II("r.q"),
        c = int( rho * II("s.a") * II("s.b") )
    )
)
And that the mathematical operations will be executed as follows, once the interpolated variables have been resolved
t = T(
    r=R(
        p=128,
        q=100
    ),
    s=S(
        a = 128 - 100,
        b = - 100,
        c = int( 0.5 * (128 - 100) * (-100) )
    )
)
To culminate having the following configuration
r:
  p: 128
  q: 100
s:
  a: 28
  b: -100
  c: -1400

Closing comment (2020-11-10T00:06:16Z): Thanks for the suggestion, this is a duplicate of #91.
Repository: omry/omegaconf

Issue #390: Feature: dataclass fields without a value can automatically indicate MISSING
Created: 2020-09-24T16:54:37Z
An historical decision was to enforce the usage of omegaconf.MISSING to indicate that a value is missing.
from omegaconf import MISSING

@dataclass
class User:
   name: str = MISSING
This creates a dependency on OmegaConf from the user dataclasses.
A better approach is to allow constructing OmegaConf configs from values that just does not specify the default value and convert it automatically to omegaconf.MISSING when constructing the config object to maintain the semantics.
@dataclass
class User:
   name: str

Duplicate issue #411: Inconsistent handling of fields without a value if dataclass or not.
Created: 2020-10-18T21:06:14Z
Fields annotated as dataclass without a value auto-expends but primitive fields are turning into MISSING.
In the example below, User and age are treated differently.
I would expect both to be MISSING ('???').
Fixing it is a breaking change, need to evaluate it carefully.
from omegaconf import OmegaConf
from dataclasses import dataclass, field
from typing import Dict

@dataclass
class User:
    age: int
    name: str = "foo"

@dataclass
class Config:
    user: User

cfg : Config = OmegaConf.structured(Config)
print(cfg)


$ python 2.py 
{'user': {'age': '???', 'name': 'foo'}}

Closing comment (2020-12-26T10:09:32Z): Done, duplicate of #390.
Repository: omry/omegaconf

Issue #1000: Incompatible with current versions of antlr4
Created: 2022-09-08T11:24:00Z
This is basically a repeat of #798, which took it from 4.8 to 4.9, and I think it indicates a systemic problem that would be good to get resolved in some way. (But I’m not getting involved—I’d just like a piece of software that happens to use omegaconf to work, but am not hung up on it.)
Trouble is that omegaconf.grammar.gen is generated ahead of time with antlr4, but antlr4 4.8, 4.9, 4.10 and 4.11 are all mutually incompatible, so you must use the same version of the antlr4 Java code that generates it, and the antlr4 Python library at runtime.
Specifying antlr4-python3-runtime==4.9.* in requirements/base.txt is all very well, but that may not be satisfiable, either due to something else depending on another version, or due to Linux distributions wanting to use the version they ship. My situation is that the python-antlr4 package in Arch Linux (community repository, meaning “official”) is at 4.11.1, so the python-omegaconf AUR package (AUR implies “unofficial”) is broken. The patch I’ve just suggested there is to depend on the antlr4 package (which provides /usr/share/java/antlr-4.11.1-complete.jar and the sans-version-number /usr/share/java/antlr-complete.jar) at build time, and patch omegaconf’s build_helpers/build_helpers.py to use the system’s copy of the antlr jar rather than the vendored one of an incompatible version. It’s certainly fair enough to say to Arch, “if you’re going to insist on violating our version requirement, you can patch it up yourself”, but it’s not an ideal situation.
I’m not just going to say “upgrade to 4.11”, though, because that just keeps you on the treadmill and is sure to create issues for others even as it fixes issues for some, because the current situation is just not good. Might be nice to figure out some way of avoiding these problems and the continual maintenance burden implied.
And maybe in the interim more deliberately support unvendoring the jar? Maybe an environment variable, to skip having to patch build_helpers/build_helpers.py?

Duplicate issue #1057: Package dependencies.
Created: 2023-02-10T17:14:10Z
omegaconf 2.3.0 has requirement antlr4-python3-runtime==4.9.*, but you have antlr4-python3-runtime 4.11.1.

Closing comment (2023-02-13T04:28:48Z): Duplicate of #1000.
Repository: omry/omegaconf

Issue #1058: structured config types are discarded on list merge
Created: 2023-02-19T09:50:12Z
Describe the bug
OmegaConf.merge(config, structured) fails to merge dataclasses contained in a list. This means type information are not present in the resultant config.
Related:
facebookresearch/hydra#2586
To Reproduce
from omegaconf import OmegaConf
from attrs import frozen

@frozen
class A:
    num: int

@frozen
class C:
    a: A
    aa: list[A]

c = OmegaConf.structured(C)
c = OmegaConf.merge(dict(a=dict(num=1), aa=[dict(num=2)]), c)
assert OmegaConf.get_type(c.a) == A
assert OmegaConf.get_type(c.aa[0]) == A  # fails
Expected behavior
All asserts pass.
Note that reversing the merge order to merge(c, dict(...)) correctly propagates the types into the list.
Additional context

 OmegaConf version: 2.3.0
 Python version: 3.11.1
 Operating system: Arch Linux

Duplicate issue #1110: Default Not Being Set
Created: 2023-07-30T05:00:16Z
First, I love OmegaConf so far.  It's almost perfect...
Describe the bug
My config has a nested dict[...,list[Child]] structure, where nested elements have defaults, but the defaults are NOT being set.
To Reproduce
from dataclasses import dataclass
from omegaconf import OmegaConf


@dataclass
class ParentConfig:
    children: dict[str, list['ChildConfig']]


@dataclass
class ChildConfig:
    required: int
    optional: int = 3


schema = OmegaConf.structured(ParentConfig)
conf = OmegaConf.create({'children': {'items': [{'required': 'r'}]}}) # NOTE: wrong type for 'required'
print(OmegaConf.merge(schema, conf)
Outputs:
{'children': {'items': [{'required': 'r'}]}}
Expected behavior
The ChildConfig item should have optional=3
Notice that I used the wrong type for required, passing a string instead of an int.  This suggests that the typing system is not recursing properly.  Perhaps only one level of nesting is hardcoded?
Additional context

 OmegaConf version: 2.3.0
 Python version: 3.11.4
 Operating system: Linux
 Please provide a minimal repro

Closing comment (2023-08-03T15:03:00Z): Thanks, at first sight it looks this may be related to #1058
Repository: omry/omegaconf

Issue #100: [Feature Request] resolve individual resolver arguments
Created: 2019-12-23T11:24:32Z
It would be nice to enable recursive interpolation.
Example :
import omegaconf
from omegaconf import OmegaConf

OmegaConf.register_resolver("plus", lambda x,y: float(x)+float(y))

c = OmegaConf.create({
        "i": 1,
        'key1': '${plus:1,2}',
        'key2': '${plus:${i},2}'
 })
print(c.key1)
# 3.0
print(c.key2)
# '${plus:1,2}'
But one would hope to get 3.0 out
Note that 2 recursion would be enough to enable the user to create deeper interpolation if they need it (by calling an other key which had already been interpolated).

Duplicate issue #212: [bug] Nested interpolations don't work
Created: 2020-04-18T19:19:22Z
Nested interpolations only resolve inner level interpolations.
a = OmegaConf.create({"a": "${hello:${default_hello:}}"})
OmegaConf.register_resolver("hello", lambda x: x)
OmegaConf.register_resolver("default_hello", lambda: 1)
print(a.a) # prints ${hello:1}
Expected: 1
The major issue this causes is when I want to register a resolver for an environmental variable's default value.
Workaround:
Register an overall resolver and resolve environment value yourself in it.

Closing comment (2020-04-18T19:37:59Z): Duplicate of #100
Repository: omry/omegaconf

Issue #149: Integer as dict key
Created: 2020-02-07T14:00:55Z
I get this error when using int as dictkey in config, is this being blocked for specific reason? If I remove the assert statement I can run successfully.
I encounter this error when I use facebookresearch/hydra, which depends on omegaconf
from omegaconf import OmegaConf
conf = OmegaConf.create( dict([(1, 2), (3, 4)]))
print(conf.pretty())  


File "C:\ProgramData\Anaconda3\lib\site-packages\omegaconf\dictconfig.py", line 35, in setitem
assert isinstance(key, str)
AssertionError

Duplicate issue #451: Feature: Dict[int, ...] key type support
Created: 2020-12-10T00:52:33Z
Hi Omry,
I noticed that a file in tests/ checks to see that DictConfig raises a Key ValidationError when OmegaConf.create({1: "a"}) is called with an int key type.
I've been using OmegaConf to validate/merge some yaml files according to a scheme defined by some dataclasses. I've run into the KeyValidationError when using dataclasses that have attributes typed as Dict[int, float], or when calling OmegaConf.load on data that has int key types.
My feeling is that it would be fairly easy to add support for int key-type by adding an elif block to the DictConfig._s_validate_and_normalize_key method to handle the int case, and by changing several type signatures from Union[str, Enum] to Union[str, int, Enum] in the dictconfig.py and _utils.py files.
I'm wondering if support for int key types (and possibly other key types that are supported by YAML, such as float and bool) is a direction that you'd be interested in going.

Closing comment (2020-12-10T02:47:24Z): Hi @Jasha10.
This is a duplicate of #149, adding such support will indeed be nice and is something I hope to get done for 2.1.
However, is a low level change that requires proper testing and documentation updates (including behavior with Structured Configs).
If you are interested in working on it file a pull request and I can provide feedback there.
Thanks!
(Closing this one because it's a duplicate).
Repository: omry/omegaconf

Issue #1158: Release schedule v2.4
Created: 2024-02-26T13:59:14Z
I was wondering what the schedule for the 2.4 release looks like.
The last stable release 2.3. was quite some time ago and there have been quite a few dev releases since.
In particular, I'm very keen to start using the cool new list merging (#1082) and don't want to add a dev dependency.

Duplicate issue #1185: Please release version 2.4.0
Created: 2024-08-07T15:49:50Z
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is.
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.

Closing comment (2024-12-20T18:43:42Z): Duplicate of #1158
Repository: omry/omegaconf

Issue #556: Remove `exclude_structured_configs`
Created: 2021-02-22T18:28:00Z
Reference:
#552 (comment)
The exclude_structured_configs argument to the OmegaConf.to_container method is scheduled to be replaced with a new argument called structured_config_mode.

Duplicate issue #548: deprecate exclude_structured_configs; introduce SCMode enum
Created: 2021-02-17T18:47:47Z
exclude_structured_configs is new in 2.1 and we can still change it.
Looks like an enum can replace exclude_structured_configs and instantiate:
class SCMode(Enum):
  DICT = 1            # convert to plain dict
  DICT_CONFIG = 2     # Keep as OmegaConf DictConfig
  INSTANTIATE = 3     # instantiate underlying object.
Originally posted by @omry in #502 (comment)
Based on the above, it is planned to deprecate the exclude_structured_configs argument to the OmegaConf.to_container function. In it's place, it is proposed to add a structured_config_mode: SCMode argument to the to_container function's signature. This argument will determine what behavior occurs when to_container encounters a StructuredConfig.
To preserve the current default behavior, the default value will be structured_config_mode = SCMode.DICT.

Closing comment (2021-02-22T23:52:15Z): Closing as duplicate of #556
Repository: onivim/oni2

Issue #2735: Feature - Editor: Add copy line / move line shortcuts
Created: 2020-11-17T23:25:49Z
From https://forum.devtalk.com/t/onivim-2-code-editor/3999/8
Add quick editing shortcuts for moving / copying lines:
Opt/Alt + up or down - this will move a line (or selection) of of code up or down
Opt/Alt + shift + up or down this will copy a line (or selection) of of code up or down

Duplicate issue #3325: Keybindings command to move lines up or down does not work
Created: 2021-03-24T09:58:24Z
I want to move lines up or down by pressing alt + k or alt + j
vs code have command editor.action.moveLinesUpAction
but onivim2, unfortunately, does nothing.
keybindings.json
[
  {
    "key": "A-k",
    "command": "editor.action.moveLinesUpAction",
    "when": "normalMode",
  },
  {
    "key": "A-j",
    "command": "editor.action.moveLinesDownAction",
    "when": "normalMode"
  },
]

Closing comment (2021-03-30T23:09:04Z): Nice catch @SimonEggert !
I'd like to add this as the default for editor.action.moveLines[Up|Down]Action - the main thing to add is setting the appropriate value in visual / select mode (the :m+ command needs to be adjusted if there is a multi-line selection).
Related to #2735
Repository: onivim/oni2

Issue #528: Feature: Vim navigation for the file explorer
Created: 2019-08-01T02:44:45Z
In Onivim 1, we had vim-style keybindings for the file explorer. In this model, the file explorer behaved as another window split, in that you could <C-w>h over to it.
Once in the explorer split, you could use h/j/k/l to navigate along with various other vim bindings. In addition, we also were able to delete (with d) and yank (with y) - and even u undo.
This was actually really nice! But there were two problems:


The d key was too easy to hit. It as easy to start typing, not realize you're focused in the file explorer, and accidentally delete a file. I think, if we bring this behavior forward, we need to find a UX that is more deliberate for deletion, yanking, pasting, and undoing.


We never implemented search for it (/). I think a useful model would be search-as-a-filter in this view, but open to ideas.

Duplicate issue #2070: [Feature] Treat file explorer as split
Created: 2020-07-05T07:31:53Z
Hi, in my vim setup I'm using NERDTree ad it is just another split this mean I can go to it with <C-W>h and move in nodes by hjkl. I think it will be nice feature in Oni.

Closing comment (2020-07-05T12:59:17Z): Closing as a duplicate of #528.
We are working towards adding this and have got some of the necessary bits in place for it now! If you have any input/suggestions after reading the linked issue, feel free to add them! Also don't forget to 👍 the issue since we use that to prioritise stuff, though that issue is already near the top I think.
Repository: onivim/oni2

Issue #471: A or I in Visual Mode only apply to one line
Created: 2019-07-25T07:51:02Z
I noticed that Oni2 crashes when you try to add some text to line starts or ends when in visual mode.
How to reproduce:

Enter some text
Press V to select it
Press A or I
(Oni2 hangs and crashes)

I expected to be able to enter text to get appended to the start (or end) of the selection.
The type of visual mode does not seem to matter. It crashes when selecting only a part of a line using v, it crashes when selecting whole lines via V and also in block selection mode via C-v.
I have used the windows artifacts built by Azure for commit b4774d6.

Duplicate issue #556: <C-v>A" freeze
Created: 2019-08-02T10:17:14Z
I was experimenting with text object, and pressing <C-v>A" make the editor freeze (this is actually not a valid Vim key combination) . Hope you can reproduce.

Closing comment (2019-08-02T15:07:41Z): Thanks for the issue @dfroger ! I believe this may be a dup of #471 - if so, would you mind '+1'-ing that issue?
Repository: onivim/oni2

Issue #1544: horizontal scroll has a limit smaller than line width
Created: 2020-04-02T05:54:45Z
I've noticed that after a certain point, longer lines seem to be cut off...

The end of line 7 has been cut off, and moving the cursor further right only makes it move off screen to the line end.
Also notice the weird highlighting with the "s" and the "u" at the end of the line.

Duplicate issue #1819: Text goes underneath minimap incorrectly
Created: 2020-05-25T08:33:28Z
On a Linux Ubuntu 18.04, Oni2 version 0.4.0 I'm getting an unexpected behaviour when text reaches the end of the screen:
text dissapears (because it goes underneath the minimap) and only after you type some more and it finally reaches the actual end of the screen, it then starts scrolling horizontally.
The way I see it, the left side of the minimap column (if I can call it this way) is the end of the edit area and it should trigger scrolling/ wrapping (if enabled) the moment text gets close to it.

Closing comment (2020-05-25T09:51:22Z): Closing as duplicate of #1544
Repository: onivim/oni2

Issue #640: Feature: Workspace Persistence
Created: 2019-08-11T16:28:17Z
I'd like to add the concept of a session to Onivim 2, which would include the following:

The working directory the user was in
Open splits / window configuration (which buffers are in which editor group)
Window size & location
Opt-in hooks for various features to persist (ie, like Zen mode)

We'd save this information to a specific location in the user's folder, likely as JSON.
On load, we'd pick up this persisted info and restore the user's workspace / session.
Related:

Once we have these basics configured, we should extend the format to handle hot exit: #639
Should integrate with #440 (when changing workspaces, we persist the current state of the 'old' workspace, and load the persisted state of the 'new' workspace)

Duplicate issue #729: Feature: Multi-Root Workspaces
Created: 2019-08-31T17:31:12Z
Sublimetext and vscode implements Workspace / Project
documentation here: http://docs.sublimetext.info/en/latest/file_management/projects.html
https://code.visualstudio.com/docs/editor/multi-root-workspaces
This feature allow to work with many folders at the same time and hold special config for it.
For example you can have back-end, front-end and worker as independent applications but feature might require to make changes in all of them
This feature might too ambitious for Pre-Alpha.
Minimal implementation might be to allow add multiple folder to file three

Closing comment (2019-09-06T02:54:30Z): Related to #640 #639 and #440
Repository: onivim/oni2

Issue #1482: Show filename before path in "Open File" instead of path
Created: 2020-03-18T20:08:00Z
Hi guys! Thank you for a great project!
When I use "Open file" and have lots of nesting folders, my path fill all available space so I can't see the exact name of the file.

For example in VSCode the filename stands before path so you can clearly see it.

I wondered if it makes sense as UI improvement. If yes - I would be glad to make a PR.

Duplicate issue #1574: Fuzzy-finder window is too small 
Created: 2020-04-07T09:53:32Z
I have pretty long paths and looking for the right file when they are prefixed the same is super hard with the current window fuzzy-finder width.

Closing comment (2020-04-07T10:20:17Z): I'll close this out as its a duplicate/related to #1482, but if you have any further input on how it should look, that would be appreicated!
Also make sure to +1 the issue!
Repository: onivim/oni2

Issue #1159: Vim - Substitution with confirm flag crashes
Created: 2020-01-04T00:58:12Z
The c flag for substitution crashes. For example:
:%s/App/app/gc
It looks like we're not properly handling the confirmation from Vim.

Duplicate issue #3155: freeze problem using vim-style substitution commands
Created: 2021-02-17T15:32:34Z
On Ubuntu 20.04, Onivim 2 (0.5.9-nightly).
Attempting to perform a vim-style substitution command freezes my whole onivim2.
For example:
:%s/blip/blop/gc
freezes my whole editor. The only option I have then is to hard-kill the editor.

Closing comment (2021-02-22T21:11:52Z): Related to #1159 , #2965 , and #3145
I just  pushed up a fix recently to address the crash (because it's horrible to hit a crash in this path) - Onivim shows a warning now with #3145:

We still need to build the find-replace experience, though (ie, fully support the c flag)
Repository: onivim/oni2

Issue #759: Using :q when only an untitled buffer is open closes OniVim
Created: 2019-09-12T00:23:34Z
I typically don't like any tab open unless i'm editing a file and I keep typing :q when only an untitled buffer is open and it closes OniVim every time. I wonder if it is possible to not close OniVim in this instance or possibly just provide a warning first before closing.

Duplicate issue #1603: Closing the last open buffer quits the entire application
Created: 2020-04-13T10:45:23Z
When having a single active buffer, closing a buffer with :q quits the entire application.
Personally, I would only prefer this to happen while in Zen mode, since we open that just to edit a single file. However, when having a project open and hitting :wq out of habit, having the application disappear from your sight is a huge bottleneck in productivity.
I would love to have a config option for this behavior. What do you guys think?

Closing comment (2020-04-13T10:50:29Z): Closing as duplicate of #759. You should give that an upvote though, to increase its priority.
Repository: onivim/oni2

Issue #759: Using :q when only an untitled buffer is open closes OniVim
Created: 2019-09-12T00:23:34Z
I typically don't like any tab open unless i'm editing a file and I keep typing :q when only an untitled buffer is open and it closes OniVim every time. I wonder if it is possible to not close OniVim in this instance or possibly just provide a warning first before closing.

Duplicate issue #3805: Keep application open after closing last tab
Created: 2021-08-12T00:28:38Z
When closing the last tab, the application quits. Is there a setting to keep the application and window open after closing the last tab?

Closing comment (2021-08-12T06:55:08Z): this is a duplicate of #759, #1603, #3552,  #2533 and #3802
Repository: onivim/oni2

Issue #1318: [Mac / Windows] Weird scaling when resizing the window.
Created: 2020-02-10T16:43:41Z
Whenever I resize the window, the content stretches or squishes until you release the cursor.

Duplicate issue #1986: The interface will be distorted when resizing the window 
Created: 2020-06-23T02:35:21Z
The interface will be distorted when resizing the window.
look this screenshot

Closing comment (2020-06-24T16:18:31Z): Thanks for logging the issue @AlawnCN and for catching the dup @mabuchner - I'll resolve this as a dup of #1318
Repository: open-goal/jak-project

Issue #2419: TIE trees in farm area sometimes seem to ignore time of day
Created: 2023-03-26T00:46:39Z

Duplicate issue #2418: shrubbery has incorrect lighting at nighttime
Created: 2023-03-26T00:35:12Z

Closing comment (2023-03-26T00:47:14Z): duplicate of #2419
Repository: open-goal/jak-project

Issue #830: [decompiler] `none` casts on event blocks
Created: 2021-09-05T18:06:57Z
It's causing issues with (event progress-normal)

Duplicate issue #928: [decomp] Forcing return value to none
Created: 2021-10-22T22:52:04Z
ice-cube
balloonlurker
target-handler

both have this issue where a function's return value is being forced to none and it seems non-obvious how to correct it.

Closing comment (2021-11-14T22:15:49Z): duplicate of #830 i've noticed