profile
viewpoint

dropbox/pyannotate 1127

Auto-generate PEP-484 annotations

dropbox/sqlalchemy-stubs 294

Mypy plugin and stubs for SQLAlchemy

gvanrossum/pyxl3 119

A Python 3 extension for writing structured and reusable inline HTML.

msullivan/LazyK 12

Updated LazyK source distribution

JukkaL/mypy-website 10

Source code for the mypy web site

msullivan/godels-t 6

Formalization of a bunch of properties of Godel's System T in agda

jwise/minilib 3

A small C library that one might wish to plop down in bare-metal projects.

msullivan/advent-of-code 3

my advent of code solutions

msullivan/cmd-queue 3

A really dumb script for running a queue of commands

msullivan/he-man 2

Haskell Event Manager, Apropos Networking

push eventedgedb/edgedb

Michael J. Sullivan

commit sha d187a93396325294037b6d77e2e498765e92965c

Fix crash when applying nested shape to a scalar. (#1795) mypy would have caught this except that lies in the AST about Optional caused it to think most of the function was unreachable. Most of this PR is actually just fixing the fallout from that. I also added parser contexts to this error while I was at it. Fixes #1788.

view details

push time in a day

delete branch edgedb/edgedb

delete branch : is_scalar_crash

delete time in a day

PR merged edgedb/edgedb

Fix crash when applying nested shape to a scalar.

mypy would have caught this except that lies in the AST about Optional caused it to think most of the function was unreachable. Most of this PR is actually just fixing the fallout from that. I also added parser contexts to this error while I was at it.

Fixes #1788.

+43 -11

0 comment

3 changed files

msullivan

pr closed time in a day

issue closededgedb/edgedb

ISE: AssertionError

The query is obviously wrong but it should fail with a proper error:

SELECT schema::ObjectType {
      name,
      is_abstract: {
        name,
      } ORDER BY @index ASC,
} FILTER .name = 'sys::Role';

Currently fails with

ERROR: InternalServerError:
  Hint: This is most likely a bug in EdgeDB. Please consider opening an issue ticket at https://github.com/edgedb/edgedb/issues/new?template=bug_report.md
  Server traceback:
      Traceback (most recent call last):
        File "/Users/yury/dev/edge/edgedb/edb/server/procpool/worker.py", line 75, in worker
          res = await meth(*args)
        File "/Users/yury/dev/edge/edgedb/edb/server/compiler/compiler.py", line 1795, in compile_eql_tokens
          return self._compile(ctx=ctx, tokens=eql_tokens)
        File "/Users/yury/dev/edge/edgedb/edb/server/compiler/compiler.py", line 1429, in _compile
          comp: dbstate.BaseQuery = self._compile_dispatch_ql(ctx, stmt)
        File "/Users/yury/dev/edge/edgedb/edb/server/compiler/compiler.py", line 1392, in _compile_dispatch_ql
          return self._compile_ql_query(ctx, ql)
        File "/Users/yury/dev/edge/edgedb/edb/server/compiler/compiler.py", line 592, in _compile_ql_query
          ir = qlcompiler.compile_ast_to_ir(
        File "/Users/yury/dev/edge/edgedb/edb/edgeql/compiler/__init__.py", line 175, in wrapper
          return func(*args, **kwargs)
        File "/Users/yury/dev/edge/edgedb/edb/edgeql/compiler/__init__.py", line 223, in compile_ast_to_ir
          ir_set = dispatch_mod.compile(tree, ctx=ctx)
        File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/functools.py", line 874, in wrapper
          return dispatch(args[0].__class__)(*args, **kw)
        File "/Users/yury/dev/edge/edgedb/edb/edgeql/compiler/stmt.py", line 84, in compile_SelectQuery
          stmt.result = compile_result_clause(
        File "/Users/yury/dev/edge/edgedb/edb/edgeql/compiler/stmt.py", line 1017, in compile_result_clause
          ir_result = compile_query_subject(
        File "/Users/yury/dev/edge/edgedb/edb/edgeql/compiler/stmt.py", line 1097, in compile_query_subject
          view_scls = viewgen.process_view(
        File "/Users/yury/dev/edge/edgedb/edb/edgeql/compiler/viewgen.py", line 86, in process_view
          view_scls = _process_view(
        File "/Users/yury/dev/edge/edgedb/edb/edgeql/compiler/viewgen.py", line 173, in _process_view
          pointer = _normalize_view_ptr_expr(
        File "/Users/yury/dev/edge/edgedb/edb/edgeql/compiler/viewgen.py", line 549, in _normalize_view_ptr_expr
          ptr_target = _process_view(
        File "/Users/yury/dev/edge/edgedb/edb/edgeql/compiler/viewgen.py", line 160, in _process_view
          assert isinstance(view_scls, s_objtypes.ObjectType)
      AssertionError

closed time in a day

1st1

push eventedgedb/edgedb

push time in 2 days

push eventedgedb/edgedb

Michael J. Sullivan

commit sha 8f05dd19fbde63857c322152d5941b9ad27904b3

WIP types

view details

push time in 2 days

issue commentedgedb/edgedb

Mark optional types in the AST as Optional

I started fixing some of this and it might be less bad than I feared but I also discovered that schema.get basically always is inferred as returning None which seems pretty bad

msullivan

comment created time in 2 days

create barnchedgedb/edgedb

branch : is_scalar_crash

created branch time in 2 days

PR opened edgedb/edgedb

Fix crash when applying nested shape to a scalar.

mypy would have caught this except that lies in the AST about Optional caused it to think most of the function was unreachable. Most of this PR is actually just fixing the fallout from that. I also added parser contexts to this error while I was at it.

Fixes #1788.

+43 -11

0 comment

3 changed files

pr created time in 2 days

issue openededgedb/edgedb

Mark optional types in the AST as Optional

A lot of fields in especially our qlast but also everywhere else are not marked Optional despite being optional.

This causes two big problems:

  1. We don't get typechecking related to the optionality
  2. In a bunch of cases mypy will decide that branches are unreachable and not typecheck them at all.

Ideally, mypy would catch that we were putting None into these non-Optional fields, but we have evaded it.

created time in 2 days

issue commentedgedb/edgedb

ISE: 'PointerRef' object has no attribute 'is_scalar'

What is the correct behavior here? Rejecting the query because target is not a link attribute?

1st1

comment created time in 2 days

push eventedgedb/edgedb

Michael J. Sullivan

commit sha d4a3b107f5956f13c09ba1022c16256589b8162c

naming things

view details

push time in 2 days

pull request commentedgedb/edgedb

Restore find_path_output as an optimization

Updated with a fix that I'm not really happy with.

msullivan

comment created time in 2 days

PullRequestEvent

push eventedgedb/edgedb

Michael J. Sullivan

commit sha 4bfc5cfa67eecd1cceb0deb39b6f01d4c85eb90e

Disable find_path_output optimization inside UNIONs

view details

push time in 2 days

PR closed edgedb/edgedb

Restore find_path_output as an optimization

This will fix an issue where fetch something twice for expr and serialized, or similar, including sometimes doing two function calls!

A fix I made in #1762 made find_path_output no longer necessary for correctness, so I removed it, but it will still important as an optimization.

Restore the optimization bit of that code, and add a comment so I don't forget and delete it again ;P.

+21 -0

1 comment

1 changed file

msullivan

pr closed time in 2 days

pull request commentedgedb/edgedb

Restore find_path_output as an optimization

Oh, oops. I ran the test suite locally and somehow then forgot it had failed between yesterday and this morning and it is broken. I'm going to close this for now because I think the problem is serious.

msullivan

comment created time in 2 days

create barnchedgedb/edgedb

branch : double-calls

created branch time in 2 days

PR opened edgedb/edgedb

Restore find_path_output as an optimization

This will fix an issue where fetch something twice for expr and serialized, or similar, including sometimes doing two function calls!

A fix I made in #1762 made find_path_output no longer necessary for correctness, so I removed it, but it will still important as an optimization.

Restore the optimization bit of that code, and add a comment so I don't forget and delete it again ;P.

+21 -0

0 comment

1 changed file

pr created time in 2 days

issue commentedgedb/edgedb

Inconsistency with volatile calls

My intuition about it was that it clearly makes sense according to our semantics that SELECT (Object, random()) should always return the same value (and, in fact, it would be pretty wrong if it didn't!)

Actually, I take this back. The "Iterate over the set of input tuples, and on every iteration evaluate the query expression" semantics does I think imply that it ought to call random() for each row, since there will be an input tuple for each Object. But a query like SELECT ({1,2,3}, random()) would call random() once, because there is only one input tuple. (This matches what currently happens in my evaluator model.)

Is this a nonstarter in terms of performance/implementation? Anything we need to do we could only do if we detect a volatile, so maybe the hypothetical perf impact isn't that bad, but correlating with every input set seems painful.

So we need to rethink how we specify the semantics, then, too, if our desired (AKA implementable) behavior is somewhere in between what we currently specify and what we implement.

msullivan

comment created time in 3 days

delete branch edgedb/edgedb

delete branch : fix-sort

delete time in 3 days

push eventedgedb/edgedb

Michael J. Sullivan

commit sha bc97e3ec333302cc26c1e450d74eb8fc99880edd

Fix a bunch of tests I wrote previously to not depend on unspecified order (#1783) * Fix a bunch of tests I wrote previously to not depend on unspecified order * I hate the 79 character limit so badly.

view details

push time in 3 days

push eventedgedb/edgedb

Michael J. Sullivan

commit sha d0a5989d4ffbcc84067d712a24d375d4476b2efe

Don't trigger recursion errors on medium-size set literals (#1785) Currently set literals get compiled into a chain of UNIONs, which causes a big blowup in the nesting depth of the AST. As a result, we trip a recursion error on set literals containing 60 one-element tuples, which is a solidly medium-size input. Fix this by compiling set literals into a tree of UNIONs instead of a chain. Fixes #475 to my satisfaction though others may disagree

view details

push time in 3 days

delete branch edgedb/edgedb

delete branch : recursion-set-literals

delete time in 3 days

PR merged edgedb/edgedb

Don't trigger recursion errors on medium-size set literals

Currently set literals get compiled into a chain of UNIONs, which causes a big blowup in the nesting depth of the AST. As a result, we trip a recursion error on set literals containing 60 one-element tuples, which is a solidly medium-size input.

Fix this by compiling set literals into a tree of UNIONs instead of a chain.

Fixes #475 to my satisfaction though others may disagree

+25 -8

0 comment

2 changed files

msullivan

pr closed time in 3 days

issue closededgedb/edgedb

RecursionError when compiling unions over many queries

Query to repro:

WITH MODULE test
FOR X IN {
     (1,), (1,), (1,), (1,), (1,), (1,), (1,), (1,), (1,), (1,), 
     (1,), (1,), (1,), (1,), (1,), (1,), (1,), (1,), (1,), (1,), 
     (1,), (1,), (1,), (1,), (1,), (1,), (1,), (1,), (1,), (1,), 
     (1,), (1,), (1,), (1,), (1,), (1,), (1,), (1,), (1,), (1,), 
}
UNION 1;

closed time in 3 days

1st1

issue commentedgedb/edgedb

Inconsistency with volatile calls

Yeah, I hit this while thinking about #492.

My intuition about it was that it clearly makes sense according to our semantics that SELECT (Object, random()) should always return the same value (and, in fact, it would be pretty wrong if it didn't!), the obvious seeming interpretation of our semantics is that FOR x IN {1, 2, 3} UNION (x, random()) should return different values, and so it should be possible to accomplish whatever we need to do without new syntax. So I figured I'd work through some examples of what workarounds were needed, which would help illuminate to me what is needed from sugar to make it easier.

(Thinking about it a little more, the most obvious reading of our semantics I think also implies that ORDER BY random() ought to work, too, though.)

(There's a plausible semantics where it is always allowed to get factored out, also, but my understanding is there are cases where we need that to not be the case. And it's less nice, IMO.)

msullivan

comment created time in 3 days

PR opened edgedb/edgedb

Don't trigger recursion errors on medium-size set literals

Currently set literals get compiled into a chain of UNIONs, which causes a big blowup in the nesting depth of the AST. As a result, we trip a recursion error on set literals containing 60 one-element tuples, which is a solidly medium-size input.

Fix this by compiling set literals into a tree of UNIONs instead of a chain.

Fixes #475 to my satisfaction though others may disagree

+25 -8

0 comment

2 changed files

pr created time in 3 days

create barnchedgedb/edgedb

branch : recursion-set-literals

created branch time in 3 days

push eventedgedb/edgedb

Michael J. Sullivan

commit sha f832ac1aaba721802a380483e6661fb15e22d8d8

I hate the 79 character limit so badly.

view details

push time in 3 days

issue commentedgedb/edgedb

RecursionError when compiling unions over many queries

A few things:

  • It looks like the error does get serialized properly now
  • It's pretty fundamental to what we do that we are going to be recursing over user-provided nested data, so this sort of thing is always a risk
  • Python's default recursion limit is 1000, which is really not very big. It's probably worth turning it up.
  • If we want to make sure to prevent this sort of thing, one option is to have a check on the original AST that the nesting depth of constructs doesn't exceed some level, and then try not to blow up the nesting level beyond some factor during our compilation passes
  • This example in particular blows up the nesting level because we turn the set literal into a linearly deep chain of UNION operators. We could make it logarithmically deep by making it a tree of UNIONs instead of a list. (Though note that this is still incompatible with the above bullet point's suggest strategy which only permits a constant factor blowup.)

So I think my proposed plan for RecursionErrors is:

  1. Turn up the recursion limit
  2. Fix anything that seems to gratuitously blow up the nesting depth but otherwise don't worry too much at this stage

(That means fixing this one to not do a linear blowup of set literals)

1st1

comment created time in 3 days

issue commentedgedb/edgedb

RecursionError when compiling unions over many queries

Both of these work now, but adding an extra row makes it fail

1st1

comment created time in 3 days

issue openededgedb/edgedb

Inconsistency with volatile calls

  1. FOR x IN {1, 2, 3} UNION (x, random()); returns identical values
  2. FOR x IN {1, 2, 3} UNION (SELECT (x, random())); returns different values
  3. SELECT (FOR x IN {1, 2, 3} UNION (SELECT (x, random()))); returns identical values (!)

I /think/ that all 3 ought to return different values but 2 and 3 definitely should do the same thing.

created time in 3 days

issue commentedgedb/edgedb

Polymorphic computables don't work

What is the semantics of this query supposed to be? Currently it doesn't even parse.

elprans

comment created time in 3 days

issue commentedgedb/edgedb

Invalid coalescing comparison operator behavior in functions

@elprans is working on a change to use UUIDs as column names, which should fix this

Fogapod

comment created time in 3 days

delete branch edgedb/edgedb

delete branch : opt-functs

delete time in 3 days

push eventedgedb/edgedb

Michael J. Sullivan

commit sha b90ff5d0c6a64ae7c7cbbf22f1fc1dd62f462c2e

Expand the tests for optional function args a bit more (#1782)

view details

push time in 3 days

create barnchedgedb/edgedb

branch : fix-sort

created branch time in 3 days

create barnchedgedb/edgedb

branch : opt-functs

created branch time in 3 days

PR opened edgedb/edgedb

Expand the tests for optional function args a bit more
+33 -0

0 comment

2 changed files

pr created time in 3 days

issue commentedgedb/edgedb

Invalid coalescing comparison operator behavior in functions

An update on this bug: SELECT test(<optional str>{}); now returns {}, which is correct. For it to return {0}, you would need the parameter to be declared optional.

It looks like the bug is now caused by name conflict: renaming the parameter to something other than nickname makes it work. Argh!

Fogapod

comment created time in 3 days

push eventedgedb/edgedb

Michael J. Sullivan

commit sha 589a2e6ec0a87625bf798121a96a0f0f0b966fdb

[toy-model] Add an Obj object for representing objects/shapes

view details

Michael J. Sullivan

commit sha 62d898873ccdeb88ce8e68f66a02714138e57d0f

[toy-model] Some refactoring, make the repl the default

view details

Michael J. Sullivan

commit sha 129e17e59836b72283cb8bb05248de9aae32048a

[toy-model] Fix link deduplication

view details

Michael J. Sullivan

commit sha daa40c10cb939b1f122cabe86b11a8b8617aa105

[toy-model] Support SELECT result_alias

view details

Michael J. Sullivan

commit sha 9b53c8db252934d0efc31cba6cc1d9ec70573efe

[toy-model] Fix SET OF args to unary operators

view details

Michael J. Sullivan

commit sha 9089e8f7faebafcc7130f271e106e1d3c200c031

[toy-model] Add a lot more functions and operators

view details

Michael J. Sullivan

commit sha 8c8e01d8bb04589138aab034057789ca06bf1ea7

[toy-model] Write a basic suite of smoke tests

view details

push time in 4 days

issue commentedgedb/edgedb

Incorrect result for a value computed in WITH block

Also: WITH X := {1, 2}, Y := X+1 SELECT (X, Y). Should produce a cross-product output with 4 results, actually produces 2.

vpetrovykh

comment created time in 4 days

push eventedgedb/edgedb

Michael J. Sullivan

commit sha 7bedf02b8deeb29b1a46ba2eeea82003e300e7da

Disallow correlation with iterator set if body contains DML (#1779) Currently we generate invalid SQL, since we would need to lift the correlated set into CTEs, which we don't want to deal with. Fixes #1739.

view details

push time in 4 days

delete branch edgedb/edgedb

delete branch : for-correlation-dml

delete time in 4 days

PR merged edgedb/edgedb

Disallow correlation with iterator set if body contains DML

Currently we generate invalid SQL, since we would need to lift the correlated set into CTEs, which we don't want to deal with.

Fixes #1739.

(Stacked on top of https://github.com/edgedb/edgedb/pull/1776, can't merge yet)

+79 -1

0 comment

3 changed files

msullivan

pr closed time in 4 days

issue closededgedb/edgedb

Properly reject correlation with FOR iterator containing DML

We should reject queries like SELECT (Person, (FOR x in {Person} UNION ((INSERT Note {name := x.name}))));

Currently we generate invalid SQL.

closed time in 4 days

msullivan

push eventedgedb/edgedb

Michael J. Sullivan

commit sha d2d90e89355fb8d8f09e3a0c085d5d7eaa794484

Support partial paths in object constraints (#1774) Fixes #1704.

view details

Michael J. Sullivan

commit sha 747ee86b4ad59baf71913b5ccdf9155cb76fb189

Fix INSERT-OR-SELECT when combined with shape (#1775) Fixes #1743.

view details

Michael J. Sullivan

commit sha 3d7b2cb9d93ea85bd1ce00bc177cd6e65ca4d345

Make sure FOR iterator statement correlates correctly (#1776) This fixes an issue introduced in #1757, where declaring a view for the iterator was done in a temporary scope in a way such that we lost the tree modifications. It turns out the real culprit is an unnecessary extra fence, so drop that.

view details

Michael J. Sullivan

commit sha 078f0544b94e1455b73029123561fe090343a808

Disallow correlation with iterator set if body contains DML Currently we generate invalid SQL, since we would need to lift the correlated set into CTEs, which we don't want to deal with. Fixes #1739.

view details

Michael J. Sullivan

commit sha b7e85c23f128e26f0d6d3788f087d01ecca1e321

types were a mistake

view details

Michael J. Sullivan

commit sha 37aed07abc962dad55fb6724037c89efa6231a1d

a more deeply nested test

view details

push time in 4 days

push eventedgedb/edgedb

Michael J. Sullivan

commit sha 3d7b2cb9d93ea85bd1ce00bc177cd6e65ca4d345

Make sure FOR iterator statement correlates correctly (#1776) This fixes an issue introduced in #1757, where declaring a view for the iterator was done in a temporary scope in a way such that we lost the tree modifications. It turns out the real culprit is an unnecessary extra fence, so drop that.

view details

push time in 4 days

delete branch edgedb/edgedb

delete branch : for-correlation

delete time in 4 days

PR merged edgedb/edgedb

Make sure FOR iterator statement correlates correctly

This fixes an issue introduced in #1757, where declaring a view for the iterator was done in a temporary scope so we lost the tree modifications.

+64 -46

1 comment

2 changed files

msullivan

pr closed time in 4 days

PR opened edgedb/edgedb

Disallow correlation with iterator set if body contains DML

Currently we generate invalid SQL, since we would need to lift the correlated set into CTEs, which we don't want to deal with.

Fixes #1739.

(Stacked on top of https://github.com/edgedb/edgedb/pull/1776, can't merge yet)

+63 -1

0 comment

3 changed files

pr created time in 4 days

create barnchedgedb/edgedb

branch : for-correlation-dml

created branch time in 4 days

Pull request review commentedgedb/edgedb

Make sure FOR iterator statement correlates correctly

 def compile_ForQuery(              iterator_view = stmtctx.declare_view(                 iterator, qlstmt.iterator_alias,-                path_id_namespace=path_id_ns, ctx=scopectx)+                new_namespace=False,+                path_id_namespace=path_id_ns,+                ctx=iterator_ctx or scopectx)

Great catch.

I did that, and threw some slight refactoring/rearrangement in because dropping such a big chunk of code into the same nesting level without any visual breaks was giving me the willies :P

msullivan

comment created time in 4 days

PullRequestReviewEvent

push eventedgedb/edgedb

Michael J. Sullivan

commit sha e7a2cf7caeeed6a77a07fcb746c9b1f83a5a2fb5

Run it back

view details

Michael J. Sullivan

commit sha fd15d85824f822bb097d53b6432aa7cccf09ceb0

Some refactoring

view details

push time in 4 days

issue commentedgedb/edgedb

Disallow overloading SINGLETON/SET OF/OPTIONAL based on type?

Maybe it's also better to disallow overloading the number of positional arguments at all?

I think I am against prohibiting overloading the number of arguments, though that is also something I could easily see myself on the other side of.

If the proposal is disallow making SINGLETON/SET OF/OPTIONAL decisions based on the number of arguments, that is pretty reasonable and might be better than my original proposal. Then the type mod of any parameter would be uniquely determined by the function and its argument position/name.

Additional knock on effects in the standard library are that std::to_datetime() would need some tweaking but that is it.

msullivan

comment created time in 4 days

issue commentedgedb/edgedb

Disallow overloading SINGLETON/SET OF/OPTIONAL based on type?

I'm not sure what you propose here. To have placeholder values in those cases, or create another modifier that can be omitted but can't be an empty set? Probably latter can fix the issue I've decsribed above, but that's another quirk of the language.

@msullivan proposes to prohibit this: [...]

~My question was specifically for this part of the proposal:~ Aha, I see we actually do differntiate between OPTIONAL arguments and arguments having a default values that can be omitted, but are not OPTIONAL...

A lot of the OPTIONAL arguments aren't really OPTIONAL, I think, also; the optionality is just there to be a default value for a parameter and probably nobody ever plans to pass a potentially empty set in.

I think I was somewhat unclear here: this sentence was really just an observation, and doesn't have any proposal attached to it. This was not really

msullivan

comment created time in 4 days

delete branch msullivan/git-mg

delete branch : lowercase-config

delete time in 4 days

issue openededgedb/edgedb

Disallow overloading SINGLETON/SET OF/OPTIONAL based on type?

Currently type-based function overloading is allowed to select argument type modifiers (SINGLETON/SET OF/OPTIONAL). There is substantial complexity in edb/edgeql/compiler/func.py and the scope tree to handle this (a bunch added recently, in #1762).

I think that argument type modifiers (SET OF, in particular, which induces subqueries) affect the semantics of the query enough that it should be easy and straightforward to determine them.

I propose that we require that all function overloads with matching signatures (number of positional args + names of name only arguments) have the same type modifiers. We can then decide which type modifiers to use based on just the function signature, before we necessarily know the types, and then figure out which exact instance later. (I wouldn't mind banning overloading SET OF here, either, since SET OF is a big deal, but I don't have any technical arguments.)

This will let us clean up function compilation to be able to know the argument kind in advance. (We could also accomplish this by having a typechecker that directly typechecks EdgeQL in advance, which I think is probably a good idea either way but is also probably a bunch of work.) It also means that an evaluation model can get away without needing to do a static typecheck. (I think. There might be other problems.)


There are currently 4 offending functions in the stdlib: std::to_str (the deprecated array overload) and cal::to_local_{datetime,date,time}. They can all be fixed without much trouble. (The second argument to the array overload for to_str can be made optional, though it is deprecated and being removed anyway, and the cal functions can have the fmt argument made named only, or made non-OPTIONAL and given a default of "" or something).

A lot of the OPTIONAL arguments aren't really OPTIONAL, I think, also; the optionality is just there to be a default value for a parameter and probably nobody ever plans to pass a potentially empty set in.

created time in 5 days

push eventedgedb/edgedb

Michael J. Sullivan

commit sha 4d60fe568b677417bc353587499724e768cd2143

tweak ctx

view details

push time in 5 days

PR opened msolo/git-mg

Fix configuration value loading

git-config appears to lowercase keys before returning them, which meant sync.excludePaths and friends weren't getting found. Look them up lowercased, instead.

I'm not sure if this is a change in behavior on git's side (it does this as of 2.20.1, at least), so to make sure, lowercase it outselves at the ingestion point.

+4 -4

0 comment

2 changed files

pr created time in 5 days

create barnchmsullivan/git-mg

branch : lowercase-config

created branch time in 5 days

fork msullivan/git-mg

A tool to facilitate working with very large git repos.

fork in 5 days

push eventedgedb/edgedb

Michael J. Sullivan

commit sha 35f2f900a01dbc704a961e0d3ec4ca855ce7e4b8

fix

view details

push time in 5 days

Pull request review commentedgedb/edgedb

Make sure FOR iterator statement correlates correctly

 def compile_ForQuery(              iterator_view = stmtctx.declare_view(                 iterator, qlstmt.iterator_alias,+                temporary=False,

OK, I'll try that. Basically every single thing about this PR has changed since that version, though :P

msullivan

comment created time in 5 days

PullRequestReviewEvent

push eventedgedb/edgedb

Michael J. Sullivan

commit sha 747ee86b4ad59baf71913b5ccdf9155cb76fb189

Fix INSERT-OR-SELECT when combined with shape (#1775) Fixes #1743.

view details

push time in 5 days

delete branch edgedb/edgedb

delete branch : ios-shape

delete time in 5 days

PR merged edgedb/edgedb

Reviewers
Fix INSERT-OR-SELECT when combined with shape

Fixes #1743.

+28 -1

0 comment

3 changed files

msullivan

pr closed time in 5 days

issue closededgedb/edgedb

Insert-or-select fails when it's combined with a shape.

  • EdgeDB Version: EdgeDB 1.0-alpha.6+dev.5050.gb8aa1c99
  • OS Version: Linux

Steps to Reproduce:

CREATE TYPE default::Foo {
    CREATE OPTIONAL SINGLE PROPERTY name -> std::str {
        CREATE CONSTRAINT std::exclusive;
    };
};
CREATE TYPE default::Bar {
    CREATE REQUIRED SINGLE LINK foo -> default::Foo;
};
INSERT Foo {name := 'foo0'};

Then the following happens:

victor> SELECT (INSERT Bar {foo := (INSERT Foo {name := 'foo0'} UNLESS CONFLICT ON .name ELSE (SELECT Foo))}) {id};
{Object {id: 948f4c8e-ed81-11ea-955a-5b32015497c5}}
victor> SELECT (INSERT Bar {foo := (INSERT Foo {name := 'foo0'} UNLESS CONFLICT ON .name ELSE (SELECT Foo))}) {id, foo};
ERROR: InternalServerError: more than one row returned by a subquery used as an expression
  Hint: This is most likely a bug in EdgeDB. Please consider opening an issue ticket at https://github.com/edgedb/edgedb/issues/new?template=bug_report.md
  Server traceback:
      edb.errors.InternalServerError: more than one row returned by a subquery used as an expression

So it's not that the cardinality check fails, it's that the SQL causes an effect similar to a cardinality problem if foo is included in the final shape to be returned.

closed time in 5 days

vpetrovykh

push eventedgedb/edgedb

Michael J. Sullivan

commit sha 2db9fe05d736baca442aac6d87433e349ed284c9

Rework it to still use a temp scope but to skip namespaces

view details

push time in 5 days

push eventedgedb/edgedb

Michael J. Sullivan

commit sha 43b86abfad9e9e3f1e29fefe0d384d0e5b05790c

[toy-model] Implement FOR and WITH

view details

push time in 5 days

Pull request review commentedgedb/edgedb

Fix INSERT-OR-SELECT when combined with shape

 def fini_dml_stmt(     # referencing this class yields the expected results.     dml_stack = get_dml_stmt_stack(ir_stmt, ctx=ctx)     if isinstance(ir_stmt, irast.InsertStmt):+        # The union CTE might have a SELECT from an ELSE clause, which+        # we don't actually want to include.+        assert len(parts.dml_ctes) == 1+        cte = next(iter(parts.dml_ctes.values()))[0]         relctx.add_type_rel_overlay(-            ir_stmt.subject.typeref, 'union', union_cte,+            ir_stmt.subject.typeref, 'unIon', cte,

This branch is only for INSERTs. The assert should always be true.

msullivan

comment created time in 5 days

PullRequestReviewEvent

push eventedgedb/edgedb

Michael J. Sullivan

commit sha 04d15a0433ac878bb3e444f166bf0fb846e9d6e6

Update edb/pgsql/compiler/dml.py oops Co-authored-by: Elvis Pranskevichus <elvis@edgedb.com>

view details

push time in 5 days

Pull request review commentedgedb/edgedb

Fix INSERT-OR-SELECT when combined with shape

 def fini_dml_stmt(     # referencing this class yields the expected results.     dml_stack = get_dml_stmt_stack(ir_stmt, ctx=ctx)     if isinstance(ir_stmt, irast.InsertStmt):+        # The union CTE might have a SELECT from an ELSE clause, which+        # we don't actually want to include.+        assert len(parts.dml_ctes) == 1+        cte = next(iter(parts.dml_ctes.values()))[0]         relctx.add_type_rel_overlay(-            ir_stmt.subject.typeref, 'union', union_cte,+            ir_stmt.subject.typeref, 'unIon', cte,

Oops on the unIon! I added that to make sure this is where a particular union in the generated code was coming from :P

msullivan

comment created time in 5 days

PullRequestReviewEvent

push eventedgedb/edgedb

Michael J. Sullivan

commit sha d2d90e89355fb8d8f09e3a0c085d5d7eaa794484

Support partial paths in object constraints (#1774) Fixes #1704.

view details

push time in 5 days

delete branch edgedb/edgedb

delete branch : subject-cnstr

delete time in 5 days

PR merged edgedb/edgedb

Reviewers
Support partial paths in object constraints

Fixes #1704.

+39 -0

0 comment

3 changed files

msullivan

pr closed time in 5 days

issue closededgedb/edgedb

Omitting `__subject__` in constraints on object types fails.

Steps to Reproduce:

EdgeDB 1.0-alpha.4+dev.145.g4d9ce642
Type "\?" for help.
victor> 
victor> 
victor> create type Vector {
.......     create required property x -> float64;
.......     create required property y -> float64;
....... };
OK: CREATE
victor> alter type Vector { create constraint expression on (.x^2 + .y^2 < 25) };
error: could not resolve partial path 
  ┌─ query:1:54
  │
1 │ alter type Vector { create constraint expression on (.x^2 + .y^2 < 25) };
  │                                                      ^^^ error

Ideally, the short path should assume __subject__ as its start.

closed time in 5 days

vpetrovykh

pull request commentedgedb/edgedb

Make sure FOR iterator statement correlates correctly

OK this isn't right yet, since WITH X := {1, 2} SELECT ((FOR x in {X} UNION (SELECT x)), X); still computes a cross product, although that bug predates the original one.

msullivan

comment created time in 5 days

PR opened edgedb/edgedb

Make sure FOR iterator statement correlates correctly

This fixes an issue introduced in #1757, where declaring a view for the iterator was done in a temporary scope so we lost the tree modifications.

+14 -1

0 comment

3 changed files

pr created time in 5 days

create barnchedgedb/edgedb

branch : for-correlation

created branch time in 5 days

issue commentedgedb/edgedb

Properly reject correlation with FOR iterator containing DML

https://github.com/edgedb/edgedb/pull/1757/ made this succeed by losing the correlation between the two Persons, which is also a bug!

msullivan

comment created time in 5 days

push eventedgedb/edgedb

Michael J. Sullivan

commit sha 6f5add48acc628ef91e8fc541e357c1b1f78a72a

Support partial paths in object constraints Fixes #1704.

view details

push time in 5 days

create barnchedgedb/edgedb

branch : ios-shape

created branch time in 5 days

PR opened edgedb/edgedb

Fix INSERT-OR-SELECT when combined with shape

Fixes #1743.

+28 -1

0 comment

3 changed files

pr created time in 5 days

create barnchedgedb/edgedb

branch : subject-cnstr

created branch time in 5 days

PR opened edgedb/edgedb

Support partial paths in object constraints

Fixes #1704.

+39 -0

0 comment

3 changed files

pr created time in 5 days

PR opened edgedb/edgedb

Disallow DELETE and UPDATE in many cases without FILTER

This patch errs on the side of disallowing, since it is pretty easy to workaround.

We allow DML when the source is filtered, comes from a query that is not a set reference, when it is a FOR iterator, and when it is the set being inserted in the ELSE clause of INSERT ... ELSE. (FOR is allowed because the meaning seems to clearly imply applying to everything ...and because it made the implementation easy.)

Most of the test cases for things we allow are existing ones.

I can follow up with a documentation update if there is agreement on this one.

Closes #1742.

+211 -40

0 comment

18 changed files

pr created time in 5 days

push eventedgedb/edgedb

Michael J. Sullivan

commit sha ef184603b6fabd4673f922ccfd80d02db77dcb34

Disallow DELETE and UPDATE in many cases without FILTER

view details

push time in 5 days

create barnchedgedb/edgedb

branch : no-te-olvides

created branch time in 5 days

push eventedgedb/edgedb

Michael J. Sullivan

commit sha 2d9945ef0c1c59d68dea0d3ad40b0e340fee5ba4

[toy-model] Implement SELECT clauses

view details

Michael J. Sullivan

commit sha ad58aba2a5d087967df4bfd93c38ca6981678fdd

[toy-model] Implement FOR and WITH

view details

push time in 5 days

push eventedgedb/edgedb

Michael J. Sullivan

commit sha e78a2870bb29ffcc2b586be3a836ea512fee6250

[toy-model] Keep going on an exception in the REPL

view details

Michael J. Sullivan

commit sha 9baf8ab1f2f2361002d10ea40ef4083873b5956b

[toy-model] Named tuple literals and tuple projection

view details

Michael J. Sullivan

commit sha 5a4f145d17e7f7ef7906d39745eb07c74b55e93d

[toy-model] Unary ops

view details

push time in 6 days

push eventedgedb/edgedb

Michael J. Sullivan

commit sha 3fa174ece09a2e25044d2161154ccad8102dda4f

[toy-model] Search for common prefixes in subqueries

view details

push time in 8 days

more