profile
viewpoint

malthe/chameleon 113

Fast HTML/XML template engine for Python

jordwest/bs-snabbdom 9

Bucklescript + Snabbdom

malthe/bs-virtualdom 5

A virtual DOM library written in OCaml/BuckleScript with a focus on ease-of-use, immutability and performance.

djangosms/core 4

Mobile messaging platform for Django

djangosms/community 2

Community contributions

malthe/audreyc 1

Audrey Compiler

headnet/plone.app.controlpanel 0

Plone's "Site Setup" UI

headnet/Products.LDAPUserFolder 0

Products.LDAPUserFolder

headnet/Products.PlonePAS 0

User and group implementation for the Plone CMS and Zope PluggableAuthService

issue commentAzure/azure-sdk-for-python

container_client.download_blob("some/path").readall() sometimes results in partial downloads (with HTTP 206 being logged in the httplib)

I have seen this issue again today with the latest release. No logs, unfortunately, but there is definitely a sporadically occurring issue here.

rblock-aw

comment created time in 4 days

issue commentpandas-dev/pandas

Memory leakage when concatting list of dataframes

This ever got looked at?

ghost

comment created time in 5 days

issue commentmalthe/pq

Performance with a very large queue

Yeah it changed here: d0602bd7e73021a4f722f9fc2007c6324df38fd5.

pramsey

comment created time in 5 days

issue commentmalthe/pq

Performance with a very large queue

Looks like your indexes are wrong: you have: expected_at NULLS FIRST rather than LAST.

pramsey

comment created time in 6 days

issue commentmalthe/pq

Performance with a very large queue

Can you paste in the table definition including the indexe(s) you have on there? Just so that there's nothing crazy hiding there.

pramsey

comment created time in 7 days

push eventmalthe/pq

danilaeremin

commit sha e47247a7fce13d7fd69d3a6e39ad7fae7c897978

Fix test_task_arguments forgotten parameter Test was green because we are checking only `job` and `expected_at`

view details

Malthe Borch

commit sha 52cbb83b8b49d62838888e229daabe837542b342

Merge pull request #61 from danilaeremin/patch-1 Fix test_task_arguments forgotten parameter

view details

push time in 8 days

PR merged malthe/pq

Fix test_task_arguments forgotten parameter

Test was green because we are checking only job and expected_at, not exactly running job

Checklist

Please make sure the following requirements are complete:

  • [x] Tests for the changes have been added (for bug fixes / features)
  • [x] Docs have been reviewed and added / updated if needed (for bug fixes / features)
  • [x] All automated checks pass (CI/CD)
+1 -1

0 comment

1 changed file

danilaeremin

pr closed time in 8 days

issue commentvaexio/vaex

Trouble marking columns as categorical

@maartenbreddels is there a feature proposal on adding support for dictionary-encoded columns?

picoDoc

comment created time in 8 days

issue commentmalthe/pq

Performance with a very large queue

So it is supposed to use the index defined here:

create index if not exists priority_idx_%(name)s on %(name)s
      (schedule_at nulls first, expected_at nulls last, q_name)
    where dequeued_at is null
          and q_name = '%(name)s';

But perhaps you don't have that index defined.

@3manuek – I don't really understand why there couldn't just be a single index (or two indexes if you count the other index as well) rather than one per value for q_name, -re- https://github.com/malthe/pq/commit/bc835d7bb8b33d145c4d4018ec462ae778e9ce42.

pramsey

comment created time in 8 days

issue commentmalthe/pq

Performance with a very large queue

Do you have an EXPLAIN ANALYZE that might help determine the needed index?

pramsey

comment created time in 13 days

pull request commentapache/arrow

PARQUET-1404: [C++] Adding Page level Indexes

I added an issue https://issues.apache.org/jira/browse/ARROW-10158.

a2un

comment created time in a month

issue commentapache/arrow

pyarrow parquet - support for row group filters

I opened a JIRA issue on this: https://issues.apache.org/jira/browse/ARROW-10158.

farnoy

comment created time in a month

delete branch malthe/ts-postgres

delete branch : patch/fix-connection-error-promise

delete time in a month

push eventmalthe/ts-postgres

Malthe Borch

commit sha c7b992f8cca51bc2dde491bf835ebb55c6502dcd

A connection error should result in promise reject

view details

Malthe Borch

commit sha b853e99ea154bb911a34111286eaad9963315d23

Mention host and port configuration using environment variables

view details

Malthe Borch

commit sha 284d1a254c44fb1d70a1318ac32e7f48916007f7

Fix linter warnings

view details

Malthe Borch

commit sha 6cf5526487957a55a834926341d36e6867369db1

Line wrap

view details

Malthe Borch

commit sha 71cfb7ab4e98cf76a5786e5c96af8863dd2feb18

Must call done explicitly

view details

Malthe Borch

commit sha d2a5afe8d279773d0a51e29bda65f484356d548c

Must detect open handles

view details

Malthe Borch

commit sha 0b039a1720ac02783855b172b0e83a9a5bb7bbba

Update to newer dev dependencies

view details

Malthe Borch

commit sha b05d84f6e645765fbe13701224c03ad4dacda966

Run in band

view details

Malthe Borch

commit sha e1b87adaae8ef3ee8cd623b68e6561756c485eee

Must dispose of active handles

view details

Malthe Borch

commit sha 4f2db58e36efbb83a06813172c658bcc8a0310fd

Prefer 'PGHOST' here

view details

Malthe Borch

commit sha d8c728398ff3648136b4f7c5fd397d28df1df6a3

Merge pull request #30 from malthe/patch/fix-connection-error-promise A connection error should result in promise reject

view details

push time in a month

PR merged malthe/ts-postgres

A connection error should result in promise reject

This fixes issue #29.

+6267 -3247

0 comment

6 changed files

malthe

pr closed time in a month

push eventmalthe/ts-postgres

Malthe Borch

commit sha 4f2db58e36efbb83a06813172c658bcc8a0310fd

Prefer 'PGHOST' here

view details

push time in a month

push eventmalthe/ts-postgres

Malthe Borch

commit sha d90a313818b9a85b9a07c7df166c56975cd908f2

Wrap line

view details

Malthe Borch

commit sha 03d00eadf6fae52d7400418817e7ba832ef01f22

Wrap line

view details

Malthe Borch

commit sha c7b992f8cca51bc2dde491bf835ebb55c6502dcd

A connection error should result in promise reject

view details

Malthe Borch

commit sha b853e99ea154bb911a34111286eaad9963315d23

Mention host and port configuration using environment variables

view details

Malthe Borch

commit sha 284d1a254c44fb1d70a1318ac32e7f48916007f7

Fix linter warnings

view details

Malthe Borch

commit sha 6cf5526487957a55a834926341d36e6867369db1

Line wrap

view details

Malthe Borch

commit sha 71cfb7ab4e98cf76a5786e5c96af8863dd2feb18

Must call done explicitly

view details

Malthe Borch

commit sha d2a5afe8d279773d0a51e29bda65f484356d548c

Must detect open handles

view details

Malthe Borch

commit sha 0b039a1720ac02783855b172b0e83a9a5bb7bbba

Update to newer dev dependencies

view details

Malthe Borch

commit sha b05d84f6e645765fbe13701224c03ad4dacda966

Run in band

view details

Malthe Borch

commit sha e1b87adaae8ef3ee8cd623b68e6561756c485eee

Must dispose of active handles

view details

push time in a month

push eventmalthe/ts-postgres

Malthe Borch

commit sha 071525a861040c7147117c39868adbf0b3daedb6

Run in band

view details

Malthe Borch

commit sha c102f302308979370c4a45eaacd3cceca15e656d

Must dispose of active handles

view details

push time in a month

push eventmalthe/ts-postgres

Malthe Borch

commit sha fb8acd0fc743314454560855c7cdd10ee080444f

Must detect open handles

view details

Malthe Borch

commit sha d04b2add2358e725c063ddf3c973a4b80d26ea20

Update to newer dev dependencies

view details

push time in a month

push eventmalthe/ts-postgres

Malthe Borch

commit sha 2ea1e97615fc01c904453e180aff6691cd9aeb7b

Must call done explicitly

view details

push time in a month

push eventmalthe/ts-postgres

Malthe Borch

commit sha 6bdcc0079acc95a3ceecf1be90c38b5b2550685e

Line wrap

view details

push time in a month

push eventmalthe/ts-postgres

Malthe Borch

commit sha e4a4525ef24ac4393443094fbad97ee51297d71e

Fix linter warnings

view details

push time in a month

push eventmalthe/ts-postgres

Malthe Borch

commit sha b45cb8480e1457be17d4c2d35f838e21d6d321c3

Mention host and port configuration using environment variables

view details

push time in a month

issue commentmalthe/ts-postgres

es modules

@chase-moskal any progress on this? It is after all https://hacktoberfest.digitalocean.com/.

chase-moskal

comment created time in a month

issue openedmalthe/ts-postgres

Support for SSL/TLS

created time in a month

PR opened malthe/ts-postgres

A connection error should result in promise reject

This fixes issue #29.

+22 -11

0 comment

2 changed files

pr created time in a month

issue openedmalthe/ts-postgres

A connection error should result in promise reject

Currently, the promise returned by connect() is left unresolved.

created time in a month

create barnchmalthe/ts-postgres

branch : patch/fix-connection-error-promise

created branch time in a month

push eventmalthe/ts-postgres

Malthe Borch

commit sha 03d00eadf6fae52d7400418817e7ba832ef01f22

Wrap line

view details

push time in a month

push eventmalthe/ts-postgres

Malthe Borch

commit sha d90a313818b9a85b9a07c7df166c56975cd908f2

Wrap line

view details

push time in a month

issue commentmalthe/ts-postgres

How to use prepare() & execute() to insert record?

@bravogolfgolf you ever got round to looking at this again?

bravogolfgolf

comment created time in a month

pull request commentmalthe/pq

Passing job_id as first argument in tasks API

@danilaeremin now released as 1.9.0 – sorry for the wait!

danilaeremin

comment created time in a month

push eventmalthe/pq

Malthe Borch

commit sha 38c436baabd68ebc984376b682e06682f28b0e64

Add missing changelog entry

view details

Malthe Borch

commit sha 21c45d24035a998faf996542dbdcd6d13bc8e3c9

Prepare release

view details

Malthe Borch

commit sha 4826c3051bee5a56a05c76e07192e464464172f0

Bump version

view details

push time in a month

created tagmalthe/pq

tag1.9.0

Simple transactional queue for PostgreSQL written in Python

created time in a month

issue closedmalthe/ts-postgres

jsonb column

Do I need to do anything special to insert/update a jsonb column in a Postgres database? I keep getting an escaped string. Here are some of the things I've tried:

Attempt #1:

const courseData = JSON.stringify(course);
await client.query(
   'INSERT INTO course (courseid, coursedata) VALUES ($1, $2) ON CONFLICT (courseid) DO UPDATE SET coursedata = $2',
   [courseId, courseData]
);

Attempt #2:

const courseData = JSON.stringify(course);
await client.query(
   'INSERT INTO course (courseid, coursedata) VALUES ($1, $2::jsonb) ON CONFLICT (courseid) DO UPDATE SET coursedata = $2::jsonb',
   [courseId, courseData]
);

Attempt #3:

      const courseData = JSON.stringify(course);
      await client.query(
        `INSERT INTO course (courseid, coursedata) VALUES ($1, $2) ON CONFLICT (courseid) DO UPDATE SET coursedata = $2`,
        [courseId, courseData],
        [DataType.Uuid, DataType.Jsonb]
      );

What am I doing wrong?

Thanks!

closed time in a month

javelinco

issue commentmalthe/ts-postgres

jsonb column

I'll close out the issue but will encourage comments that can improve upon this solution. There might be a more idiomatic way to express it than going via unknown.

javelinco

comment created time in a month

issue commentmalthe/ts-postgres

jsonb column

What happens if you explicitly cast it to JsonMap, e.g.

import { JsonMap } from 'ts-postgres';

...
await client.query(sqlQuery, [courseId, <JsonMap> courseData]);

To be honest I never thought about this issue.

javelinco

comment created time in a month

issue commentmalthe/ts-postgres

jsonb column

Don't stringify – just pass course where the query demands a json or jsonb type.

In some situations, you will need to type-cast (as you have done with $2::jsonb) but this depends on the query. PostgreSQL is often times able to determine the correct type and will send this type information back to the client.

javelinco

comment created time in a month

pull request commentzopefoundation/z3c.jbot

Add support for Plone resource overrides

This has been released as version 1.1.0.

malthe

comment created time in a month

push eventzopefoundation/z3c.jbot

Malthe Borch

commit sha 952864f381c35c94503f94aa10256b02978b1454

Preparing release

view details

Malthe Borch

commit sha c16f9302b96b5994939c877a0fcf28d9739ee921

Version bump

view details

push time in a month

created tagzopefoundation/z3c.jbot

tag1.1.0

Drop-in template overrides.

created time in a month

PR opened zopefoundation/z3c.jbot

Add support for Plone resource overrides

This adds support for overriding static resources as registered by plone.resource.

Note that in principle this could live in a new "plone.jbot" package, but since we already have support for Zope 2 CMF objects (when Zope 2 is present), it is considered to be a reasonable inclusion here.

+153 -20

0 comment

10 changed files

pr created time in a month

create barnchzopefoundation/z3c.jbot

branch : feature/add-support-for-plone-resource

created branch time in a month

Pull request review commentponylang/rfcs

Add RFC for Recover blocks with receiver

+- Feature Name: recover-with-receiver+- Start Date: 2020-08-26+- RFC PR: (leave this empty)+- Pony Issue: (leave this empty)++# Summary++This feature will expand recover syntax to allow general usage of+recovery as appears in automatic receiver recovery. The change+will make some use cases possible, while improving the performance+or ergonomics of some other use cases.++# Motivation++Currently, Pony supports two forms of recovery, `recover` blocks,+as well as automatic receiver recovery. In some cases, these are+equivalent. If we have a single variable `x: T iso`, then we can+temporarily use it as another capability inside a recover block,+with something like:+```+x = recover+   let x_ref = consume ref x+   // do something with x ...+   x_ref+end+```+Alternatively, if the action being taken is precisely a ref method call,+then automatic receiver recovery can be used if the+arguments and return types meet the isolation guarantees for `x`.+```+x.foo(y, z)+```+But this can't be used for every type of action, it needs to be those+actions thought of by the original class developer. We can add these methods,+but this is anti-modular.++This automatic receiver recovery syntax also works for expressions more complicated than a single variable of course.+The recover block is less flexible. The recover block method can be used only when the thing being modified is a mutable location.+It can be used with var fields, but not with let or embed. It can be used when we have update methods, but not with getters alone.+```+// defined elsehwere+class Foo+   fun box getSomething(): this->Bar ref+   ...+   fun box values(): this->FooIterator ref++class FooHolder+   embed foo: Foo iso = Foo+   // or let++   fun ref doSomethingWithFoo() =>+      // error, iso->ref = tag+      foo.getSomething().somethingElse()++      // try to recover to use foo as ref: error, can't assign+      foo = recover+         ... consume foo+      end+   end+```+We might also have read-only methods. Imagine we take in an Iter over iso objects. We don't want to be coupled to+the class used, such as Array, and allow a generic, potentially chained iterator.+```+class UsesIter[T: SomeInterface]+   fun process(iter: Iterator[T]) =>+      // want to call a few complicated methods on T+      // if T might be unique, we can't store in a variable,+      // so we want to recover, but we can't!++      // error, not a subtype+      let next: T = iter.next()?++      // ????+      iter.next() = recover+         ...+      end++      // works... but only if we can+      // express *all* of the things we want+      // to do as multiple methods+      // still anti-modular!+      iter.next()?.foo().>bar()+   end+```++This RFC will add a syntax to expand the design of recover blocks to allow a receiver, subsuming automatic receiver recovery.+In both cases above, the recover with receiver may be used in order to temporarily use these values as ref, allowing free+usage of methods, without requiring that the methods were defined ahead of time in the interface or class, and without+requiring extra potentially erroring accesses or allocating and swapping new values via update methods.++# Detailed design++We will add new syntactic forms to allow recover blocks based around an existing receiver expression.++```+e.recover as x =>+   e+end

@jasoncarr0 that confused me as well; I think e.recover | x => ... f(x) end (or similar) would be more readable.

jasoncarr0

comment created time in 2 months

PullRequestReviewEvent

issue openedconda/conda

Documentation missing for 4.7

There is no documentation available online for 4.7; only 4.6.x and master.

created time in 2 months

push eventmalthe/pq

Danila Eremin

commit sha d5b0cdbe754feeae65ba18cd6e68901686474753

Passing job_id as first argument in tasks API

view details

Danila Eremin

commit sha 4c9d77eb7ab414160d5fb22a4c333bcd16b81bec

tests

view details

Danila Eremin

commit sha 0bd7fb79b41cbf15314e925630743dac21a7dc90

Add note in readme

view details

Danila Eremin

commit sha 3d47e355dabfa111cd5b605a6a087e8f85f14caf

Check new job id is not equal to initial value of test_value

view details

Malthe Borch

commit sha 445c1352abb23ca3899022cc458cb529085910dc

Merge pull request #59 from danilaeremin/executor_job_id Passing job_id as first argument in tasks API

view details

push time in 2 months

PR merged malthe/pq

Passing job_id as first argument in tasks API

Related to https://github.com/malthe/pq/issues/58

What is the current behavior?

There is no mechanism for getting id of current executing job in Task API.

What is the new behavior?

Passing job.id as first positional argument in Task API.

Checklist

Please make sure the following requirements are complete:

  • [x] Tests for the changes have been added (for bug fixes / features)
  • [x] Docs have been reviewed and added / updated if needed (for bug fixes / features)
  • [x] All automated checks pass (CI/CD)
+31 -10

0 comment

3 changed files

danilaeremin

pr closed time in 2 months

issue commentmalthe/pq

Get id of current task

I think it might be cleaner then to simply provide job_id as the first positional argument. Users of the tasks module would then have to update their code.

danilaeremin

comment created time in 2 months

push eventmalthe/pq

danilaeremin

commit sha bd3538f50fd0bc3f5ca90e0df6ad193caf988cc5

Return id of created job Useful for tracking job status outside of job

view details

danilaeremin

commit sha 557d7b750d54d509ed2a7f9e04f6551617df691e

Add test

view details

Malthe Borch

commit sha 6370c97cf0fe468c56421d254271ef236fc980d6

Merge pull request #57 from danilaeremin/patch-1 Return id of created job

view details

push time in 2 months

PR merged malthe/pq

Return id of created job

Useful for tracking job status outside of job

What is the current behavior?

queue.put doesn't return anything

What is the new behavior?

queue.put return id of new job

Checklist

Please make sure the following requirements are complete:

  • [x] Tests for the changes have been added (for bug fixes / features)
  • [x] Docs have been reviewed and added / updated if needed (for bug fixes / features)
  • [x] All automated checks pass (CI/CD)
+11 -1

0 comment

2 changed files

danilaeremin

pr closed time in 2 months

issue commentmalthe/ts-postgres

How to use prepare() & execute() to insert record?

Certainly one thing I would change right away is to await the query executions rather than return them.

It isn't necessarily a problem how you do it, but it looks weird that you're queuing up a client.end() before getting the query results.

Another thing is that it's probably a good idea to use a session pool. Here's an example that uses generic-pool:

import { createPool } from 'generic-pool';
import { Client, DatabaseError } from 'ts-postgres';
import * as pino from 'pino';

const logger = pino().child({ 'module': 'postgres' });

function select(...columns: string[]) {
    return 'select ' + columns.join(', ');
}

let count = 0;

export function createPgPool(
    database: string,
    secret: Buffer,
    min: number,
    max: number) {
    return createPool({
        create: async () => {
            const serial = (count += 1);
            const client = new Client({
                database: database
            });

            try {
                await client.connect();

                client.on(
                    'error',
                    (err: DatabaseError) => {
                        logger.error({ 'code': err.code }, err.message);
                    }
                );

                const result = await client.query(
                    select(
                        'pg_backend_pid()',
                        'set_config(\'app.secret\', $1::bytea::text, false)'
                    ),
                    [secret]
                );

                const pid = result.rows[0][0];
                logger.info({
                    serial: serial,
                    pid: pid
                }, 'New database connection');
                return client;
            } catch (error) {
                logger.info(
                    { error: error.message },
                    'Error connecting to database'
                );
                await new Promise((resolve) => {
                    setTimeout(resolve, 1000);
                })
                throw new Error('Connection error');
            }
        },
        destroy: async (client: Client) => {
            return client.end().then(() => { })
        },
        validate: (client: Client) => {
            return Promise.resolve(!client.closed);
        }
    }, { min: min, max: max, testOnBorrow: true });
};
bravogolfgolf

comment created time in 2 months

issue commentmalthe/ts-postgres

How to use prepare() & execute() to insert record?

I have adapted an existing test case to look like this one and it does seem to work:

testWithClient(
    'Prepare and execute (alt)',
    async (client) => {
        const stmt = await client.prepare('select $1::int as i');
        const promise = stmt.execute([1]);
        await stmt.close();
        const result = await promise;
        expect(result.rows).toEqual([[1]]);
    });

What you might want to try is to coerce the arguments to PostgreSQL types (e.g. int as in the example).

But it would also be informative to know what the database responds to this query. What's in the log? Does the query succeed?

bravogolfgolf

comment created time in 2 months

issue commentNaturalHistoryMuseum/ckanext-ldap

Did you create a release in pypi?

I suppose it would be reasonable to assume that the title here was a mistake and should have read "Are you planning to make a release on PyPi".

idgserpro

comment created time in 2 months

delete branch zopefoundation/z3c.pt

delete branch : stevepiercy-patch-1

delete time in 2 months

push eventzopefoundation/z3c.pt

Steve Piercy

commit sha 6ba736c40352b26f1baf5775395093525a47c770

Revise comment on boolean HTML attributes This PR updates the comment on boolean HTML attributes to accurately reflect the intent of the XHTML 1.0 specification. See https://github.com/malthe/chameleon/issues/318#issuecomment-675933941

view details

Malthe Borch

commit sha 7a5025b07db3ae5d4df513b8e9eb4c20add9ac59

Merge pull request #19 from zopefoundation/stevepiercy-patch-1 Revise comment on boolean HTML attributes

view details

push time in 2 months

PR merged zopefoundation/z3c.pt

Reviewers
Revise comment on boolean HTML attributes

This PR updates the comment on boolean HTML attributes to accurately reflect the intent of the XHTML 1.0 specification.

See https://github.com/malthe/chameleon/issues/318#issuecomment-675933941

+4 -4

0 comment

1 changed file

stevepiercy

pr closed time in 2 months

issue commentmalthe/chameleon

Bug in rendering tal:attributes in case of boolean values?

@stevepiercy yeah I think that would be helpful. Thanks!

DadaDaMotha

comment created time in 2 months

issue commentmalthe/chameleon

Bug in rendering tal:attributes in case of boolean values?

I am not sure I understand. What is the expected output?

DadaDaMotha

comment created time in 2 months

issue closedmalthe/pq

Pipenv using old create.sql

Expected Behavior

PQ.create() is idempotent

Actual Behavior

Subsequent calls to PQ.create() fails.

Steps to Reproduce the Problem

  1. pip install pipenv
  2. mkdir pq-pipenv && cd pq-pipenv
  3. pipenv --python 3.7
  4. pipenv install pq psycopg2-binary
  5. pipenv run pip freeze
  6. Create the following file test.py
from psycopg2 import connect
from pq import PQ

conn = connect('postgres://xx:xx@localhost:5432/xx')
pq = PQ(conn)
pq.create()
  1. Execute the script more than once pipenv run python test.py.
[jodewey:~/pq-pipenv] % pipenv run python test.py
[jodewey:~/pq-pipenv] % pipenv run python test.py
Traceback (most recent call last):
  File "test.py", line 6, in <module>
    pq.create()
  File "/Users/jodewey/.local/share/virtualenvs/pq-pipenv-EeMTMI3R/lib/python3.7/site-packages/pq/__init__.py", line 63, in create
    cursor.execute(sql, {'name': Literal(queue.table)})
psycopg2.errors.DuplicateTable: relation "queue" already exists
CONTEXT:  SQL statement "CREATE TABLE queue (
  id          bigserial    PRIMARY KEY,
  enqueued_at timestamptz  NOT NULL DEFAULT current_timestamp,
  dequeued_at timestamptz,
  expected_at timestamptz,
  schedule_at timestamptz,
  q_name      text         NOT NULL CHECK (length(q_name) > 0),
  data        json         NOT NULL
)"
PL/pgSQL function inline_code_block line 3 at SQL statement

After further investigation the create.sql file in the virtualenv is old. It does not contain the version from 1.8.1.

[jodewey:~/pq-pipenv] % cat /Users/jodewey/.local/share/virtualenvs/pq-pipenv-EeMTMI3R/lib/python3.7/site-packages/pq/create.sql
do $$ begin

CREATE TABLE %(name)s (
  id          bigserial    PRIMARY KEY,
  enqueued_at timestamptz  NOT NULL DEFAULT current_timestamp,
  dequeued_at timestamptz,
  expected_at timestamptz,
  schedule_at timestamptz,
  q_name      text         NOT NULL CHECK (length(q_name) > 0),
  data        json         NOT NULL
);

end $$ language plpgsql;

create index priority_idx_%(name)s on %(name)s
    (schedule_at nulls first, expected_at nulls first, q_name)
    where dequeued_at is null
          and q_name = '%(name)s';

create index priority_idx_no_%(name)s on %(name)s
    (schedule_at nulls first, expected_at nulls first, q_name)
    where dequeued_at is null
          and q_name != '%(name)s';

drop function if exists pq_notify() cascade;

create function pq_notify() returns trigger as $$ begin
  perform pg_notify(new.q_name, '');
  return null;
end $$ language plpgsql;

create trigger pq_insert
after insert on %(name)s
for each row
execute procedure pq_notify();

Specifications

  • Version:
[jodewey:~/pq-pipenv] 1 % pipenv run pip freeze
pq==1.8.1
psycopg2-binary==2.8.5
  • Python version:
[jodewey:~/pq-pipenv] % python --version
Python 3.7.6

closed time in 2 months

retr0h

issue commentmalthe/pq

Pipenv using old create.sql

I have released 1.8.2. Sorry for the wait!

retr0h

comment created time in 2 months

push eventmalthe/pq

Malthe Borch

commit sha 2fb8cc48d9151376d240ffae43d82f18fcb23ddb

Version bump

view details

push time in 2 months

created tagmalthe/pq

tag1.8.2

Simple transactional queue for PostgreSQL written in Python

created time in 2 months

push eventmalthe/pq

Malthe Borch

commit sha eb14d08900c334a49279f3214741bd9dd70a6883

Prepare relase

view details

push time in 2 months

PR opened sqlalchemy/sqlalchemy

Use pg_get_constraintdef for CHECK constraint reflection

Revised the query used when reflecting CHECK constraints to make use of the pg_get_constraintdef function, as the consrc column is being deprecated in PG 12. Thanks to John A Stevenson for the tip.

Fixes: #4463 Change-Id: Ie0ee9bdfddb0635db72b35c2e2e4b27f154162fd (cherry picked from commit 377f12696bb1af17bb14f676a49ef21428d537d3)

<!-- Provide a general summary of your proposed changes in the Title field above -->

Description

<!-- Describe your changes in detail -->

Checklist

<!-- go over following points. check them with an x if they do apply, (they turn into clickable checkboxes once the PR is submitted, so no need to do everything at once)

-->

This pull request is:

  • [ ] A documentation / typographical error fix
    • Good to go, no issue or tests are needed
  • [x] A short code fix
    • please include the issue number, and create an issue if none exists, which must include a complete example of the issue. one line code fixes without an issue and demonstration will not be accepted.
    • Please include: Fixes: #<issue number> in the commit message
    • please include tests. one line code fixes without tests will not be accepted.
  • [ ] A new feature implementation
    • please include the issue number, and create an issue if none exists, which must include a complete example of how the feature would look.
    • Please include: Fixes: #<issue number> in the commit message
    • please include tests.

Have a nice day!

+36 -4

0 comment

3 changed files

pr created time in 3 months

create barnchmalthe/sqlalchemy

branch : backport/issue-4463

created branch time in 3 months

fork malthe/sqlalchemy-1

The Database Toolkit for Python

https://www.sqlalchemy.org

fork in 3 months

issue commentckan/ckanext-spatial

VDM only works with SQLAlchemy versions 0.4 through 0.8, not: 1.0.14

Note that vdm now supports SQLAlchemy up to 1.3: https://pypi.org/project/vdm/0.15/.

coreyerickson

comment created time in 3 months

PR opened okfn/vdm

Fix error message

The package now supports SQLAlchemy all the way up to 1.3.

+1 -1

0 comment

1 changed file

pr created time in 3 months

push eventmalthe/vdm

Malthe Borch

commit sha 3e5a91b3adb9bea1530393316fa2fc50e4048625

Fix error message The package now supports SQLAlchemy all the way up to 1.3.

view details

push time in 3 months

fork malthe/vdm

Versioned domain model. Python library for revisioning/versioning of databases.

http://packages.python.org/vdm/

fork in 3 months

issue commentMicrosoftDocs/azure-docs

"401 Unauthorized" when testing using a local Docker container

How does the program get the function key when it's running on Azure? Through an environment variable or network call? One would think that it can be simulated in a non-Azure environment, i.e. running locally using Docker for example.

petertuton

comment created time in 3 months

issue commentMicrosoftDocs/sql-docs

What does not work with Synapse right now

I see the same error and i do use the format that you suggest (although <folder> might also be a specific blob name such as <folder>/<filename> – at least I suppose that is allowed since it works with the ".blob." endpoint).

kartas39

comment created time in 3 months

more