text:
Swap the placement of PermiteUserEnvironment

This commit will rework the way PermitUserEnvironment is added to
sshd_config by putting it at the top of the file.
Without this commit you will create a bad sshd_config if your sut's
base image containes matching blocks the end of its sshd_config
because the PermitUserEnvironment option is not allowed there.  This
ordering is likely perferred since it is generally the norm to put
matching blocks at the end of the sshd_config.

Refer to this link for build results (access rights to CI server needed):
http://jenkins-beaker.delivery.puppetlabs.net//job/qe_beaker_btc-intn/1892/
Test FAILed.

Refer to this link for build results (access rights to CI server needed):
http://jenkins-beaker.delivery.puppetlabs.net//job/qe_beaker_btc-intn/1894/
Test FAILed.

@rick I am going to need a hand understanding how beaker is testing its self because this works in actual practice.

This appears to be a case where the mockist/stubbist spec suite is carping because there's a mock object passing around that will complain if unknown methods are called on it, and, well, that happens on most useful changes.  (Cue grumbling about how this doesn't help with refactorings and changes).
The shortest path fix is to add some stubs or expectations to some object in that spec suite; the more ideal longer-term fix is to improve the specs, and lean more on acceptance tests where only mocking/stubbing is otherwise possible. :crying_cat_face:
The tests output in question (for posterity):
Failures:

  1) Beaker set_env sets user ssh environment on an ssh-based linux host
     Failure/Error: directory = create_tmpdir_on(self)

     NoMethodError:
       undefined method `create_tmpdir_on' for name:Unix::Host
     # ./lib/beaker/host/unix/exec.rb:190:in `ssh_permit_user_environment'
     # ./lib/beaker/host_prebuilt_steps.rb:532:in `block in set_env'
     # ./lib/beaker/shared/host_manager.rb:115:in `run_block_on'
     # ./lib/beaker/dsl/patterns.rb:35:in `block_on'
     # ./lib/beaker/host_prebuilt_steps.rb:525:in `set_env'
     # ./spec/beaker/host_prebuilt_steps_spec.rb:608:in `test_host_ssh_calls'
     # ./spec/beaker/host_prebuilt_steps_spec.rb:591:in `test_host_ssh_set_user_environment'
     # ./spec/beaker/host_prebuilt_steps_spec.rb:533:in `block (3 levels) in <top (required)>'

  2) Beaker set_env sets user ssh environment on an sshd-based linux host
     Failure/Error: directory = create_tmpdir_on(self)

     NoMethodError:
       undefined method `create_tmpdir_on' for name:Eos::Host
     # ./lib/beaker/host/unix/exec.rb:198:in `ssh_permit_user_environment'
     # ./lib/beaker/host_prebuilt_steps.rb:532:in `block in set_env'
     # ./lib/beaker/shared/host_manager.rb:115:in `run_block_on'
     # ./lib/beaker/dsl/patterns.rb:35:in `block_on'
     # ./lib/beaker/host_prebuilt_steps.rb:525:in `set_env'
     # ./spec/beaker/host_prebuilt_steps_spec.rb:608:in `test_host_ssh_calls'
     # ./spec/beaker/host_prebuilt_steps_spec.rb:591:in `test_host_ssh_set_user_environment'
     # ./spec/beaker/host_prebuilt_steps_spec.rb:537:in `block (3 levels) in <top (required)>'
rake aborted!
Failed to 'bundle exec rspec' (exit status: pid 48751 exit 1)
/var/lib/jenkins/workspace/qe_beaker_unit-rb_rspec/ruby/1.9.3-p484/Rakefile:39:in `block (3 levels) in <top (required)>'
/var/lib/jenkins/workspace/qe_beaker_unit-rb_rspec/ruby/1.9.3-p484/Rakefile:33:in `block (2 levels) in <top (required)>'
/var/lib/jenkins/workspace/qe_beaker_unit-rb_rspec/ruby/1.9.3-p484/Rakefile:10:in `block in <top (required)>'
/var/lib/jenkins/workspace/qe_beaker_unit-rb_rspec/ruby/1.9.3-p484/Rakefile:23:in `block in <top (required)>'
/usr/local/rvm/gems/ruby-1.9.3-p484/bin/ruby_executable_hooks:15:in `eval'
/usr/local/rvm/gems/ruby-1.9.3-p484/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => test:spec
(See full trace by running task with --trace)

  3) Beaker set_env sets user ssh environment on an sles host
     Failure/Error: directory = create_tmpdir_on(self)

     NoMethodError:
       undefined method `create_tmpdir_on' for name:Unix::Host
     # ./lib/beaker/host/unix/exec.rb:202:in `ssh_permit_user_environment'
     # ./lib/beaker/host_prebuilt_steps.rb:532:in `block in set_env'
     # ./lib/beaker/shared/host_manager.rb:115:in `run_block_on'
     # ./lib/beaker/dsl/patterns.rb:35:in `block_on'
     # ./lib/beaker/host_prebuilt_steps.rb:525:in `set_env'
     # ./spec/beaker/host_prebuilt_steps_spec.rb:608:in `test_host_ssh_calls'
     # ./spec/beaker/host_prebuilt_steps_spec.rb:591:in `test_host_ssh_set_user_environment'
     # ./spec/beaker/host_prebuilt_steps_spec.rb:541:in `block (3 levels) in <top (required)>'

  4) Beaker set_env sets user ssh environment on a solaris host
     Failure/Error: directory = create_tmpdir_on(self)

     NoMethodError:
       undefined method `create_tmpdir_on' for name:Unix::Host
     # ./lib/beaker/host/unix/exec.rb:208:in `ssh_permit_user_environment'
     # ./lib/beaker/host_prebuilt_steps.rb:532:in `block in set_env'
     # ./lib/beaker/shared/host_manager.rb:115:in `run_block_on'
     # ./lib/beaker/dsl/patterns.rb:35:in `block_on'
     # ./lib/beaker/host_prebuilt_steps.rb:525:in `set_env'
     # ./spec/beaker/host_prebuilt_steps_spec.rb:608:in `test_host_ssh_calls'
     # ./spec/beaker/host_prebuilt_steps_spec.rb:591:in `test_host_ssh_set_user_environment'
     # ./spec/beaker/host_prebuilt_steps_spec.rb:545:in `block (3 levels) in <top (required)>'

  5) Beaker::Hypervisor#configure if :disable_iptables option set false does not call disable_iptables
     Failure/Error: directory = create_tmpdir_on(self)

     NoMethodError:
       undefined method `create_tmpdir_on' for vm1:Unix::Host
     # ./lib/beaker/host/unix/exec.rb:198:in `ssh_permit_user_environment'
     # ./lib/beaker/host_prebuilt_steps.rb:532:in `block in set_env'
     # ./lib/beaker/shared/host_manager.rb:115:in `run_block_on'
     # ./lib/beaker/shared/host_manager.rb:104:in `block in run_block_on'
     # ./lib/beaker/shared/host_manager.rb:103:in `map'
     # ./lib/beaker/shared/host_manager.rb:103:in `run_block_on'
     # ./lib/beaker/dsl/patterns.rb:35:in `block_on'
     # ./lib/beaker/host_prebuilt_steps.rb:525:in `set_env'
     # ./lib/beaker/hypervisor.rb:119:in `configure'
     # ./spec/beaker/hypervisor/hypervisor_spec.rb:80:in `block (4 levels) in <module:Beaker>'

  6) Beaker::Hypervisor#configure if :disable_iptables option set true calls disable_iptables once
     Failure/Error: directory = create_tmpdir_on(self)

     NoMethodError:
       undefined method `create_tmpdir_on' for vm1:Unix::Host
     # ./lib/beaker/host/unix/exec.rb:198:in `ssh_permit_user_environment'
     # ./lib/beaker/host_prebuilt_steps.rb:532:in `block in set_env'
     # ./lib/beaker/shared/host_manager.rb:115:in `run_block_on'
     # ./lib/beaker/shared/host_manager.rb:104:in `block in run_block_on'
     # ./lib/beaker/shared/host_manager.rb:103:in `map'
     # ./lib/beaker/shared/host_manager.rb:103:in `run_block_on'
     # ./lib/beaker/dsl/patterns.rb:35:in `block_on'
     # ./lib/beaker/host_prebuilt_steps.rb:525:in `set_env'
     # ./lib/beaker/hypervisor.rb:119:in `configure'
     # ./spec/beaker/hypervisor/hypervisor_spec.rb:88:in `block (4 levels) in <module:Beaker>'

Finished in 34.31 seconds (files took 4.48 seconds to load)
1196 examples, 6 failures

Refer to this link for build results (access rights to CI server needed):
http://jenkins-beaker.delivery.puppetlabs.net//job/qe_beaker_btc-intn/1895/
Test FAILed.

@ody this is ugly, but it gets you :green_heart: :+1:
diff --git a/spec/beaker/host_prebuilt_steps_spec.rb b/spec/beaker/host_prebuilt_steps_spec.rb
index 4a48933..ac46c32 100644
--- a/spec/beaker/host_prebuilt_steps_spec.rb
+++ b/spec/beaker/host_prebuilt_steps_spec.rb
@@ -604,7 +604,7 @@ describe Beaker do

       expect( subject ).to receive( :construct_env ).and_return( opts )
       expect( host ).to receive( method_call_sym )
-
+      host.stub(:create_tmpdir_on)
       subject.set_env(host, options.merge( opts ))
     end

diff --git a/spec/beaker/hypervisor/hypervisor_spec.rb b/spec/beaker/hypervisor/hypervisor_spec.rb
index be04f43..1477b68 100644
--- a/spec/beaker/hypervisor/hypervisor_spec.rb
+++ b/spec/beaker/hypervisor/hypervisor_spec.rb
@@ -77,6 +77,7 @@ module Beaker
         it "does not call disable_iptables" do
           options[:disable_iptables] = false
           expect( hypervisor ).to receive( :disable_iptables ).never
+          hosts.each { |host| host.stub(:create_tmpdir_on) }
           hypervisor.configure
         end
       end
@@ -85,6 +86,7 @@ module Beaker
         it "calls disable_iptables once" do
           options[:disable_iptables] = true
           expect( hypervisor ).to receive( :disable_iptables ).exactly( 1 ).times
+          hosts.each { |host| host.stub(:create_tmpdir_on) }
           hypervisor.configure
         end
       end

/cc @puppetlabs/beaker with :pray: for a better solution...

@rick Not sure what I came up with is any better.  As I recall it is pretty much the same this but different syntax.

Refer to this link for build results (access rights to CI server needed):
http://jenkins-beaker.delivery.puppetlabs.net//job/qe_beaker_btc-intn/1897/
Test FAILed.

Refer to this link for build results (access rights to CI server needed):
http://jenkins-beaker.delivery.puppetlabs.net//job/qe_beaker_btc-intn/1899/
Test FAILed.

Fun.  This works perfectly with the vagrant hypervisor I developed with.

Refer to this link for build results (access rights to CI server needed):
http://jenkins-beaker.delivery.puppetlabs.net//job/qe_beaker_btc-intn/1900/
Test FAILed.

Refer to this link for build results (access rights to CI server needed):
http://jenkins-beaker.delivery.puppetlabs.net//job/qe_beaker_btc-intn/1903/
Test FAILed.

Refer to this link for build results (access rights to CI server needed):
http://jenkins-beaker.delivery.puppetlabs.net//job/qe_beaker_btc-intn/1908/
Test FAILed.

@puppetlabs-jenkins retest this please

Refer to this link for build results (access rights to CI server needed):
http://jenkins-beaker.delivery.puppetlabs.net//job/qe_beaker_btc-intn/1917/
Test PASSed.

@ody, would you please add the (MAINT) prefix to the commit message for this change?  Sorry I missed this earlier.  Once that's done, we'll be able to get that merged.

@kevpl np. done.  Sorry you have to keep telling me that.  I am not yet use to what is and isn't a maintenance thing.

Refer to this link for build results (access rights to CI server needed):
http://jenkins-beaker.delivery.puppetlabs.net//job/qe_beaker_btc-intn/1926/
Test PASSed.

authors: kevpl ody puppetlabs-jenkins rick

repo: puppetlabs/beaker


text:
Using multiple modules directories

I keep modules in two different sub directories: site for mine code and modules for modules downloaded from Forge. As far as Puppet goes it can use both directories to look for modules. With Bolt, trying to pass them in modulepath-way (as --modules ./site:./modules) or with two parameters (--modules ./site --modules ./modules) ends in either my plan not being found, or dependencies not being met.

Hi [@therek], thanks for filing this. We're currently tracking this in https://tickets.puppetlabs.com/browse/BOLT-122 and somewhat related https://tickets.puppetlabs.com/browse/BOLT-121.

BTW. I think by default Bold should try to use puppet config print modulemath if path is not set explicite.

FWIW - the puppet PAL API (used by bolt) already supports being given a modulepath, and if given a configured puppet environment, will use the modulepath defined for that environment.

@therek The fix for multiple module directories was merged in https://github.com/puppetlabs/bolt/commit/c59edaa3eeca8348c0bdd1413c5e958ebde1a172. Note the option has changed to modulepath instead of modules, so I'm going to close this.
There is on-going discussion/work planned to default the modulepath option to whatever puppet is using. That work is being tracked in https://tickets.puppetlabs.com/browse/BOLT-121. Feel free to comment/watch that ticket.

source: gharchive/issue

authors: cardil hlindberg joshcooper therek

repo: puppetlabs/bolt

license_type: permissive

license_source: github-api


text:
(maint)(Don't Merge) Add 'hypervisor: none' to non-provisioned node definitions

[skip-ci]
Merge after release!

/cc @johnduarte

source: gharchive/pull-request

repo: puppetlabs/puppet


text:
(PUP-6269) Backport PUP-3341 to 3.x (fix, apply.rb only)

apply.rb changes from this commit:
https://github.com/puppetlabs/puppet/commit/04634314408fa227220a8c6d0429d419c1754a4d

Waiting for CLA signature by @robb-reporo
@robb-reporo - We require a Contributor License Agreement (CLA) for people who contribute to Puppet, but we have an easy click-through license with instructions, which is available at https://cla.puppet.com/
Note: if your contribution is trivial and you think it may be exempt from the CLA, please post a short reply to this comment with details. http://docs.puppet.com/community/trivial_patch_exemption.html

This is exempt from CLA as it is Felix Frank's code, already commited in the 4.x branch.

Two things:
Can you update the commit message so it reads:
(PUP-6269) Backport PUP-3341 to 3.x

(I fixed the title of this PR already)
We use the tags in the commit message to correlate commits with tickets when we do a release - hence being picky.
Not sure how to deal with the CLA; clearly Felix Frank authored the fix, but it does not show in the commit. We may need to patch that up unless you sign the CLA (which is a simple process).

I have backported the tests too now, so I have...
Finished in 4 minutes 13 seconds
21477 examples, 0 failures, 126 pending
Would you like a single commit with all the changes? Should I just make a new pull request?

This looks like a mess, I will make a pull request with a single correctly named commit.

authors: hlindberg puppetcla robmbrooks


text:
(PUP-5909) Add Serializer and Deserializer and a JSON packer/unpacker

This PR adds what's needed to perform serialization/deserialization of primitives, arrays, hashes, and complex objects that are described using the Puppet Object type. The mechanism is designed to work on differnent protocols using an underlying abstract reader/writer. A reader/writer pair for JSON is included in this PR.

CLA signed by all contributors.

Pushed a commit that is rebased on master. It also contains a revised version of the packer_spec.rb where irrelevant copy pasted comments are removed and TimeFactory tests were rewritten.

AppVeyor was failing on what seems to be unrelated (non existing methods called by facter). Restarted the AppVeyor build job on this PR.

authors: hlindberg puppetcla thallgren


text:
(maint) Relax win32-dir

Allow bundler to install win32-dir 0.7.2 that contains the ASLR fix.
This change affects bundler and the runtime dependencies for the win32
specific versions of the puppet gem. It is important to continue accepting
win32-dir 0.4.9, because that is what we ship in the puppet-runtime.
Since win32-dir 0.7.2 only supports ruby 2.4 and up, this change drops the ruby
2.3 and windows rspec combination. Ruby 2.3 went EOL March 28, 2018.
The change to ruby-prof was due to bundler pulling in a a version that wasn't
compatible with older ruby versions. So restrict that to ruby >= 2.5. It's only
needed when running the memory related benchmarks.

I guess this is also happening because of ASLR, now when you're getting the object_id of an object_id(which is an integer), the values are stored at different address.
# before ASLR:
 > a = "123"

 > a.object_id.object_id
 => 25561
 > a.object_id.object_id
 => 25561

# with ASRL:
> a = "123"

> a.object_id.object_id
=> 1439091456340
> a.object_id.object_id
=> 1439091320220

Just a thought: I think the issue here manifests only on Ruby 2.5.9 provided by RubyInstaller. I found this on the MSYS2 homepage (which is used in RubyInstaller) and I think it might be the culprit. ASLR was enabled by default in MSYS2 at the end of January 2021, which means that all RubyInstaller builds that come after that date are impacted by this change. To outline, the issue is with the RubyInstaller MSI, not with the OS configuration, as we were also able to reproduce this internally.
Since all rubies 2.5 and older went EOL, we can probably assume that there won't be any new versions of those rubies, and no affected RubyInstaller ASLR MSIs. So we might get away with your change @joshcooper, and still keep Ruby 2.3 in the GH Actions matrix if we want. I assume that by relaxing the version, bundler on Ruby 2.3 will get the last win32-dir version with Ruby 2.3 support (it shouldn't matter if it contains the ASLR fix or not, as the RubyInstaller builds of Ruby 2.3 don't have ASLR on), and bundler on Ruby 2.4 and higher will get version 0.7.2 of the gem (which has the fix).

authors: GabrielNagy gimmyxd joshcooper


text:
(PDB-2565) Change =-after? to assert-equal-after

This wraps the entire macro in an is assertion. Since all cases where this was
used did this anyway, it provides more convenience. However, the main reason was
to ensure that the differential between the old and new values actually gets
printed during testing instead of simply returning the expectation of being true.
Signed-off-by: Ken Barber ken@bob.sh

Needs to be merged in-sync with this: https://github.com/puppetlabs/pe-puppetdb-extensions/pull/173

Refer to this link for build results (access rights to CI server needed):
http://jenkins-enterprise.delivery.puppetlabs.net/job/enterprise_puppetdb_init-multijob_githubpr-stable/162/
Test PASSed.

Refer to this link for build results (access rights to CI server needed):
http://jenkins-enterprise.delivery.puppetlabs.net/job/enterprise_puppetdb_init-multijob_githubpr-stable/163/
Test PASSed.

authors: kbarber puppetlabs-jenkins

repo: puppetlabs/puppetdb

license_source: bigquery


text:
Allow user to modify loglevel of apt-get update Exec resource

The goal of this PR is to optionally eliminate unnecessary Notices in the syslog and in agent reports. When the apt_update Exec resource runs successfully the Notice is interpreted by Foreman as a "host modification performed without error." While this is, in some sense, true, it's not something I care to know about at the default level of logging and it's reasonable to optionally reduce it.
Confirmed to be a no-op with these hiera data:
apt::update:
  frequency: daily

Confirmed to eliminate logging at the default agent level of notice when these data are used:
apt::update:
  frequency: daily
  loglevel: debug

@tpdownes, Having this as a configurable option totally makes sense. Great change. However The loglevel variable you are referencing is not set anywhere. It will need to be documented in the readme and a test for the new attribute would be preferable.

@tphoney I'm happy to add a README section and to explicitly set it to undef in apt::params:: update_defaults. What you probably won't find useful from me is a check since I don't really know ruby and that's what I think I see being done in Travis. I can learn or try. Is there an easy example to follow?

Any attempt is very welcome, get the attribute in the readme and update the params. That will will be enough.
Many thanks !!!!

Thanks for the positive feedback! Should be good to go with revised commit once it builds.
FYI: the TOC in README.md begins at 2. Didn't bother fixing. I didn't think the numbers mattered but I tend to just repeat use 1. for every item in my ordered lists and have found that works in the flavor of markdown used by GitLab (rather than GitHub).

Many thanks @tpdownes!!
@jbondpdx are you happy with the readme changes ?

Many thanks @tpdownes

Hi, @tpdownes
Could you please elaborate how did that solution work for you?
I've defined apt::update with loglevel set to debug and I actually don't see any notes from this resource in the report. But Foreman still shows the status of such Puppet runs as "updated" / "changed", so it's always blue, not green.
I guess that is an expected behavior because an underlying exec resource is always executing. But I just wondering how did you solve it :)
P.s. My Foreman version is 1.8.1.

@legal90 yeah, I had thought it would properly suppress that in Foreman but it doesn't. I left the MR in place because, well, it's nice not to have it at stdout.
In Debian 9, a daily systemd timer is automatically installed, so I might think of having puppetlabs-apt switch to that model even for Debian 8 (and Ubuntu variants) while it remains LTS.

authors: legal90 tpdownes tphoney

repo: puppetlabs/puppetlabs-apt


text:
(MODULES-2519) Places for More DSC Information

Initial feedback suggests that someone without direct knowledge of DSC will not know how to use our module because they do not know how to find information on how to use DSC. We should add some links to the quickstarts on Technet and some of the official PowerShell team blog posts

Address those minor issues and we're :+1:

Thanks @jpogran - looks good.

authors: Iristyle jpogran

repo: puppetlabs/puppetlabs-dsc


text:
Add reasonable default values for SSL security-related settings

Default configuration of HAProxy doesn't protect SSL endpoints against several security issues (like POODLE or use of insecure RC4 algorithm). I would suggest adding some global options to fix this, as described in https://starefossen.github.io/post/2015/01/26/securing-ssl-in-haproxy/

Apologies for taking so long to look at this, thanks for the work you have put into this pull request. However due to inactivity and failing unit tests this pull request is being closed. If you want to re-submit this PR with the necessary changes, we will gladly look at the new pull request.

authors: lklimek tphoney

repo: puppetlabs/puppetlabs-haproxy


text:
server::extension: Excempt system database "template1" from requires.

The system database template1 is also always present and does not need management by this module.

Hi @olifre,
According to the official documentation here the template1 is still used by default installation of Postgresql on the CREATE DATABASE command, therefore having the possibility to manage this would allow you to define the templates you need in your next database creations. As a result of this fact we sadly have to decline this PR for now.
Thank you for your contributions and we are sorry for any inconvenience caused.

Hi @carabasdaniel ,
I see! Just to clarify, this change was not about removing the possibility to manage template1, but just about removing the enforcement of having to manage the template1 database with this module to be able to define a postgresql::server::extension resource using the template1 database.
I do not completely follow why the database itself, which is guaranteed to exist (as documentation still states), must also be managed by the module to be allowed to enable an extension on it (while this is not the case for other builtin databases such as postgres).
In any case, if somebody stumbles upon this at some point, the workaround is simple — just add this to your catalogue:
        postgresql::server::database { 'template1':
                istemplate      => true,
        }

and then postgresql::server::extension will also work with the template1 database.
Cheers and thanks,
Oliver

authors: carabasdaniel olifre

repo: puppetlabs/puppetlabs-postgresql


text:
Support full rabbitmq node names in cluster_nodes

This change allows a full rabbitmq node name including service name to be specified in the cluster_nodes parameter.
Backwards compatibility (prepend 'rabbit@') is maintained unless the node name has an '@' in it, in which case it is used verbatim.

The result of the test was: FAIL
Details at http://ci.puppet.community/buildlogs/puppetlabs+puppetlabs-rabbitmq+349+1432930963+FAIL
I am a beta ci bot. I am probably lying to you.
You can contact nibalizer for more details.

The result of the test was: FAIL
Details at http://ci.puppet.community/buildlogspuppetlabs+puppetlabs-rabbitmq+349+1433196217+FAIL
I am a beta ci bot. I am probably lying to you.
You can contact nibalizer for more details.

The result of the test was: FAIL
Details at http://ci.puppet.community/buildlogspuppetlabs+puppetlabs-rabbitmq+349+1433200365+FAIL
I am a beta ci bot. I am probably lying to you.
You can contact nibalizer for more details.

Hi There
I'm closing this PR as the tests fail. If you wish to have this feature included, please resubmit your PR with the tests fixed.
Thanks!

repo: puppetlabs/puppetlabs-rabbitmq


text:
非bug！！！，只是对于代码有点疑问，望大佬解惑

描述问题 (Describe the problem)
感谢大佬开源此后台系统，相关文档配套做的很用心，下面是在看源码时存在疑惑的地方

formatFlatteningRoutes 方法里已经进行了层级树的递归构建，所以上述的buildHierarchyTree是不是可以进行移除
如何复现该问题 (How to reproduce the problem)
非bug！！！！
操作系统和浏览器信息 (Operating system and browser information)
No response
验证 (Verify)

[X] 是否仔细阅读过 文档 (Have you read documentation carefully)
[X] 检查是否存在相同或类似的问题 issues (Check for the same or similar issues)

不好意思 目前只解决bug

repo: pure-admin/vue-pure-admin

license: MIT


text:
Implement code generation for Branch & PrimOp

This PR tracks the implementation of the Convert.purs file.

I think (further) development of the prelude port should happen alongside this PR, such that we can test optimizations specific to the core of the language. Of course, I can always cheat and define stubs for modules that have yet to be ported.
I can also imagine that porting would be accelerated if we generated stubs for the foreign files based on the foreign imports in a PureScript module.

The latest iteration of this PR adds a runtime module that includes polyfills for missing functions that we need (e.g. boolean comparison operators)

The latest iteration of this PR adds a runtime module that includes polyfills for missing functions that we need (e.g. boolean comparison operators)

Can this line be removed then?

authors: JordanMartinez purefunctor

repo: purescm/purescm


text:
0.12rc compiler fixes

Could we have a compiler/0.12 branch made and move this in there for now?

ping, this is updated

compiler/0.12 already has all these changes. I guess Gary decided it was easier to do them himself %%

authors: justinwoo kRITZCREEK

repo: purescript-contrib/purescript-nullable


text:
Improvements

1 - Allow draggable gesture to open sidebar
Improvements in methods:
1 - Customization when create sidebar set background color, font color, and width of sidebar
2 - Add the options, addItems([['id?','title','image','item-caption'],...])
3 - addItem(item)
4 - removeAllItems()
5 - removeItem(id)
6 - blockDrag();
7 - allowDrag();

is covered in the other improvements.

I'll add individual issues for addItem/removeItem/removeAll and allow/block dragging

authors: GustavoCostaW purplecabbage

repo: purplecabbage/phonegap-plugin-sidebar


text:
Pushe library increases signed app's size

my apk's size (by proguard) is Almost 5mb,  but when I added pushe library size became 15mb(sometimes 10mb), how to fix that?

15 MB doesn't seem sensible to me since there aren't much code in Pushe + All its deps. 10MB does though.
There's nothing to fix. If you have nothing in common with Pushe dependencies, you'll get a larger pack at the end.
Libraries otherthan Pushe that will be added to classpath are quite large:

Firebase-messaging
WorkManager
A few AndroidX jetpack such as life-cycle related ones
Huawei PushKit (if you add :hms module for huawei)
RxJava2

Together they make the final pack quite larger (specially for an almost empty APK)
If there's gonna be a remake to the project, it will be much smaller. However, next release will only be bugFix and the size issue still remains intact.

Update to this. Since deletion of RxJava2 from the library is really complex and time-consuming, after some minor updates to the library I'll be working on a solution to reduce the final AAR size of all modules.
Unfortunately, I can not specify a deadline for now.
Will notify in the issue as soon as I have new updates.

hi again, any update?

Not yet. The focus is on automation development and the improvements have lower priority. So tge process is in paused state temporarily.

authors: mahdi-malv razaghimahdi

repo: pusheco/pushe-android-studio-sample


text:
Is there a way to authenticate from server side apps

Is there a way to provide credentials and get the auth cookie without seeing the provider's login page which requires user interaction.
We do have some backend code (desktop app, postman test scripts, etc..) which need to get authorized in order to call our apis running behind K8s Ingres with oauth2_proxy. It would be nice to have an option to send credentials from a backend code to get authorization cookie that we can make calls to the APIs.

looking for this as well

I am looking for this as well

Hey @omeryesil, could you provide a few extra details to help us work this out with you?
Which provider are you using?
Have you managed to get an ID Token for your backend code?
Have you seen the work done in #65? (Apologies it isn't really documented)
I believe the work from #65 may solve your issue, it was originally discussed in #18

authors: JoelSpeed omeryesil tatroc thangbn


text:
Post installation Aurora on centos 7 its not working.

Hi,
I installed LAMP and follow  guide  https://afterlogic.com/docs/aurora-files/installation/installing-from-repository   to install and every step went well but as per step 6 "Now you are ready to open a URL pointing to the installation directory in your favorite web browser."
Whenever I try to open URL pointing to the installation directory http://Server-IP/var/www/aurora/data/aurora-files-latest than it is saying "The requested URL /var/www/aurora/data/aurora-files-latest was not found on this server."
project aurora-files-latest]# ls -lrt
total 2084
-rw-r--r--   1 root root    1146 Mar  6 16:26 travis.sh
-rw-r--r--   1 root root     403 Mar  6 16:26 travis.php
-rw-r--r--   1 root root      30 Mar  6 16:26 robots.txt
-rw-r--r--   1 root root    3440 Mar  6 16:26 README.md
-rw-r--r--   1 root root     879 Mar  6 16:26 pre-config.json
-rw-r--r--   1 root root    2698 Mar  6 16:26 modules.json
-rw-r--r--   1 root root   33881 Mar  6 16:26 LICENSE
-rw-r--r--   1 root root     773 Mar  6 16:26 index.php
-rw-r--r--   1 root root     118 Mar  6 16:26 gulpfile.js
-rw-r--r--   1 root root   17542 Mar  6 16:26 favicon.ico
-rw-r--r--   1 root root    1257 Mar  6 16:26 dav.php
-rw-r--r--   1 root root     896 Mar  6 16:26 composer.json
-rw-r--r--   1 root root    1235 Mar  6 16:26 apigen-overview.md
-rw-r--r--   1 root root    2036 Mar  6 16:26 apigen.neon
-rw-r--r--   1 root root    1237 Mar  6 16:26 apidoc-overview.md
-rw-r--r--   1 root root     340 Mar  6 16:26 apidoc.json
-rw-r--r--   1 root root 1874955 Jul 30 14:16 composer.phar
drwxr-xr-x  12 root root    4096 Aug  1 16:39 system
drwxr-xr-x   4 root root    4096 Aug  1 16:40 dev
drwxr-xr-x  44 root root    4096 Aug  1 16:43 modules
-rw-r--r--   1 root root   93428 Aug  1 16:43 composer.lock
drwxr-xr-x  19 root root     292 Aug  1 16:43 vendor
drwxr-xr-x   4 root root      50 Aug  1 16:43 data
drwxr-xr-x 568 root root   16384 Aug  1 16:55 node_modules
drwxr-xr-x   4 root root      30 Aug  1 16:57 static
-rw-r--r--   1 root root      14 Aug  1 16:58 VERSION
[root@project aurora-files-latest]# pwd
/var/www/aurora/data/aurora-files-latest
Please help me. Thanks

Thanks , It is fixed now and due to permission issue .

license: mit


text:
Type mapping with AutoValue/AutoParcel

Link to discussion on reddit: https://www.reddit.com/r/androiddev/comments/38nx2t/weekly_anything_goes_thread/crxm900
The problem:
SQLiteTypeMapping and ContentResolverTypeMapping store pairs for type mapping with exact class, for example: [(Tweet.class, TweetPutResolver), (Tweet.class, TweetGetResolver)...].
But with AutoValue and AutoParcel it won't resolve required class.

There was one hiccup with AutoParcel and SQLiteTypeMapping. AutoParcel generates child class for every annotated class, but it's package private and can't be used when creating type mapping but type mapping created using parent class doesn't work with child object since prepare operation uses getClass to find appropriate type mapping. For example:

@AutoParcel
public abstract class Foo {
    abstract int id();
    abstract String bar();
    public static Foo create(int id, String bar) {
        return new AutoParcel_Foo(id, name);
}

StorIOSQLite storIOSQLite = new DefaultStorIOSQLite.Builder()
.sqliteOpenHelper(helper)
.addTypeMapping(Foo.class, new SQLiteTypeMapping.Builder<Foo>()
    .putResolver(new FooPutResolver())
    .getResolver(new FooGetResolver())
    .deleteResolver(new FooDeleteResolver())
    .build())
.build();

Foo foo = Foo.create(0, "baz"); // foo.getClass returns AutoValue_Foo

storIOSQLite
  .put()
  .object(foo)
  .prepare() // prepare can't find mapping for AutoValue_Foo
  .executeAsBlocking()

On user side it can be solved by specifying concrete right resolver for every operation or using generated class type in type mapping and resolver declaration neither of which very flexible. How it can be solved in library I have no idea. So for now I stopped using AutoValue for db entity objects (same with Gson based entities since AutoValue doesn't play nice with it either).

I made two solutions:
1 TypeMapping can store synonym classes
addTypeMapping(Foo.class, new SQLiteTypeMapping.Builder<Foo>()
    .putResolver(new FooPutResolver())
    .getResolver(new FooGetResolver())
    .deleteResolver(new FooDeleteResolver())
    .addSynonymClass(AutoParcel_Foo.class)
    .build())

And StorIO will use resolvers of Foo.class for Foo.class itself and for all its synonyms.
2 Use Class.isAssignableFrom() and check that passed class has mapping for its parent class, no user action required.
And, I decided to implement 2nd solution, because it's pretty cheap for performance (I made caching) and it's easy for users. Works with @AutoParcel like a charm.

Cool! But I guess with second solution we can meet a little problem.
What if we have hierarchy of classes and use @AutoParcel.
For example: User <|-- UserDetails.
So User <|-- AutoParcel_User and UserDetails <|-- AutoParcel_UserDetails
And try to add different type mapping for it:
addTypeMapping(User.class, new SQLiteTypeMapping.Builder<User>()     .getResolver(new UserGetResolver())     .build())
and
addTypeMapping(UserDetails.class, new SQLiteTypeMapping.Builder<UserDetails>()     .getResolver(new UserDetailsGetResolver())     .build())
Auto parcel for both classes User and UserDeatails will not have direct type mapping, and when we will search indirect one for UserDetails, we can firstly meet User type mapping  (typeWithMapping.isAssignableFrom(type) will return true =( )
I.e. it depends on luck what we will meet firstly in
for (Class<?> typeWithMapping) typesMapping.keySet()) loop.

Damn, you're right...
8 июня 2015 г. 9:19 AM пользователь "Dmitrii Nikitin" <
notifications@github.com> написал:

Cool! But I guess with second solution we can meet a little problem.
What if we have hierarchy of classes and use @AutoParcel.
For example: User <|-- UserDetails.
So User <|-- AutoParcel_User and UserDetails <|-- AutoParcel_UserDetails
And try to add different type mapping for it:
addTypeMapping(User.class, new SQLiteTypeMapping.Builder()
.getResolver(new UserGetResolver())
.build())
and
addTypeMapping(UserDetails.class, new
SQLiteTypeMapping.Builder()
.getResolver(new UserDetailsGetResolver())
.build())
Auto parcel for both classes User and UserDeatails will not have direct
type mapping, and when we will search indirect one for UserDetails, we
can firstly meet User type mapping (typeWithMapping.isAssignableFrom(type)
will return true =( )
I.e. it depends on luck what we will meet firstly in
for (Class<?> typeWithMapping) typesMapping.keySet()) loop.
—
Reply to this email directly or view it on GitHub
https://github.com/pushtorefresh/storio/issues/365#issuecomment-109877277
.

Okay, I can solve this, but it'll be liiitle slower, just a little for most of the cases. I'll count "how many classes between these two in the inheritance relation" and then I'll choose most closer class with known type mapping.

Maybe with caching it will be ok

Yep
8 июня 2015 г. 10:48 AM пользователь "Dmitrii Nikitin" <
notifications@github.com> написал:

Maybe with caching it will be ok
—
Reply to this email directly or view it on GitHub
https://github.com/pushtorefresh/storio/issues/365#issuecomment-109894545
.

authors: artem-zinnatullin nikitin-da

repo: pushtorefresh/storio


text:
build/Release-iphoneos/PushyRN/PushyRN.modulemap' not found 1 error generated.

As soon as i add pushy react native to package.json i get the above error. How do i resolve this.

Hi @sohamad,
We'd be glad to assist.
Please do not manually add pushy-react-native to your project's package.json. The necessary steps for installing our React Native SDK are as follows:
Run the following command in the root directory of your project to install the pushy-react-native package from npm:
npm install pushy-react-native --save

Run the following command to link the ios native module to your project:
react-native link pushy-react-native

Run the following command to install the PushyRN Cocoapods dependency:
cd ios && pod install

Finally, please close all open Xcode projects and make sure to reopen your RN project using the new *.xcworkspace file by running this command:
open *.xcworkspace

Rebuild your project, and it should build successfully this time.
Please let us know if you face any other issues that we can assist with.

I haven't added it manually i have only added it with npm install only.

I have added Pushy.swift file as well nothing seems to be working i am blocked at this point.

Hi @sohamad,
Let's continue discussions in the new issue you created (#73).

authors: pushy-me sohamad

repo: pushy-me/pushy-react-native


text:
🛑 Payment Gateway is down

In 25f7c8d, Payment Gateway (https://payment.unmer.ac.id/) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Payment Gateway is back up in d865a98.

repo: pusimgit/upptime


text:
Updating Content on Radio Select

Question
Craft 3.6.2
Sprig 1.3.2
Wishlist 1.4.4
I'm working with Wishlist and attempting to get a redirect input to be different depending on a radio select. However, no matter what I try it either doesn't work or the template breaks.
this form adds either , all english books, all french books, or all books, to a cart/wishlist. I need to have the page redirect to a different page/query string depending on the selection:
/education/memoirs/?bookTotal=all-english
/education/memoirs/?bookTotal=all-french
/education/memoirs/?bookTotal=all-books
Form adds to wishlist successfully if I remove any sprig code.
Am stuck on the sprig part  - here's my existing code:

{% set currentUrl = craft.app.request.getAbsoluteUrl() %}

{# get bookTotal so we can conditionall load redirect #}
{% set bookTotal = craft.app.request.getParam('bookTotal') ?? '' %}

{% do sprig.pushUrl('?' ~ {bookTotal: bookTotal}|url_encode) %}

<form method="POST" sprig>

  <input type="hidden" name="action" value="wishlist/items/add">
  {{ csrfInput() }}

  <fieldset class="order-entire-collection-box">

        <legend>{{ "Order the entire Azrieli Holocaust Memoirs collection:"|t }}</legend>

          {% set checked = checked ?? '' %}

          {% for entry in craft.entries.section('books').search('bookLanguages:english').isUpcomingRelease(0).all() %}
            <input type="hidden" name="items[{{ loop.index }}][elementId]" value="{{ entry.id }}" data-book-type="inEnglish"  disabled="disabled">
          {% endfor %}

          <input type="hidden" name="bookTotal" value="all-english">

          <input class="form-check-input" type="radio" name="orderAll" id="inEnglish" value="english" {{ checked }}>
          {{ "in English"|t }}

          {#
            add this redirect if this radio button is selected
            copy functionality to other radio buttons once working
          #}

            {{ bookTotal }}

          {% if bookTotal == 'all-english' %}
            {{ redirectInput('/education/memoirs/?bookTotal=all-english') }}
          {% endif %}

          {% for entry in craft.entries.section('books').search('bookLanguages:french').isUpcomingRelease(0).all() %}
            <input type="hidden" name="items[{{ loop.index }}][elementId]" value="{{ entry.id }}" data-book-type="inFrench" disabled="disabled">
          {% endfor %}

          <input class="form-check-input" type="radio" name="orderAll" id="inFrench" value="french">
          {{ "in French"|t }}

          {% for entry in craft.entries.section('books').isUpcomingRelease(0).all() %}
            <input type="hidden" name="items[{{ loop.index }}][elementId]" value="{{ entry.id }}" data-book-type="inEnglishFrench"  disabled="disabled">
          {% endfor %}

          <input class="form-check-input" type="radio" name="orderAll" id="inEnglishFrench" value="English-and-French">

          {{ "in English & French"|t }}

        <button class="order-all">{{ "Add to Cart"|t }}</button>

  </fieldset>
</form>

Additional context
Add any other context or screenshots about the support request here.

Since you're attempting to redirect from inside a Sprig component, you cannot rely on a plugin's controller to do this. Instead, use the sprig.redirect template variable, see https://putyourlightson.com/plugins/sprig#sprig.redirecturl

I got this doing what I wanted without the redirect but rather buy pushing a query string and making each radio button a component.
In case this helps anyone in the future here's the component code:
{# get bookTotal so we can conditionall load redirect #}
{% set orderAll = craft.app.request.getParam('orderAll') ?? '' %}

<input
  class="form-check-input"
  type="radio"
  name="orderAll"
  id="inEnglish"
  value="english"
  s-push-url="?orderAll=english"
  s-trigger="change"
  {{ orderAll == 'english' ? 'checked' }}
  sprig
  >

{{ "in English"|t }}

{% if orderAll =="english" %}
  {{ redirectInput('/education/memoirs/?orderAll=english') }}
{% endif %}

authors: CreateSean bencroker

repo: putyourlightson/craft-sprig


text:
Add link to ASV pvlib-benchmarker in documentation

Problem
I can't find any reference or links to the ASV benchmarker in the documentation
Solution
I think a small section with a link to the ASV benchmarker and some discussion about why we benchmark pvlib, how to use read the results, and whatever
Alternatives
There are links in the pull request #1049
Additional context
The benchmarks are really cool, and it's impressive that we have them, so we should advertise and help people use them and solicit their feedback on how we can improve, what's useful, what's not, etc.

ICYMI, there technically is a trail of breadcrumbs that gets you to the benchmark graphs page, but it's a little roundabout:

https://pvlib-python.readthedocs.io/en/stable/contributing.html#benchmarking
https://github.com/pvlib/pvlib-python/blob/master/benchmarks/README.md

But it's not very discoverable and can certainly be made more useful.

ICYMI, there technically is a trail of breadcrumbs that gets you to the benchmark graphs page, but it's a little roundabout:

https://pvlib-python.readthedocs.io/en/stable/contributing.html#benchmarking
https://github.com/pvlib/pvlib-python/blob/master/benchmarks/README.md

But it's not very discoverable and can certainly be made more useful.

Agh! I searched different variations of benchmark(s) and benchmarker, but not "benchmarking" and evidently the sphinx/rtd search engine is very picky.

Agh! I searched different variations of benchmark(s) and benchmarker, but not "benchmarking" and evidently the sphinx/rtd search engine is very picky.

How about adding to the table of badges in the main readme?

How about adding to the table of badges in the main readme?

Working on this issue @mikofski

opened pull request for this recommendation

closed by #1427

authors: Naman-Priyadarshi kanderso-nrel mikofski wholmgren

repo: pvlib/pvlib-python


text:
e3dc/mode

A question regarding value "e3dc/mode".
It jumps every few seconds between "1" and "2" within my installation S10X from Oct 2023.
In docker I see this log entry:
Error: Tag 0x06800400 received error code 4294967295.
In rsc2mqtt log file I see:
[2023-12-17 10:56:38] pid=1 ppid=0 RscpMqttMain.cpp(324) topic >e3dc/system/software< payload >H20_2023_024< unit ><
I tried to grab the values via mqtt explorer

my .config
// IP address of the E3/DC S10 device
E3DC_IP=192.168.X.Y
// Port of the E3/DC S10 device, default is 5033
E3DC_PORT=5033
// E3/DC account
E3DC_USER=mail@adress.tld
E3DC_PASSWORD=password
// AES password
E3DC_AES_PASSWORD=password
// Target MQTT broker
MQTT_HOST=192.168.X.Y
// Default port is 1883
MQTT_PORT=1883
// MQTT user / password authentication necessary? Depends on the MQTT broker configuration.
MQTT_AUTH=false
// if true, then enter here
MQTT_USER=
MQTT_PASSWORD=
// MQTT parameters
MQTT_QOS=0
MQTT_RETAIN=false
// Topic prefix (max 24 characters), default is e3dc
PREFIX=e3dc
// log file
LOGFILE=rscp2mqtt.log
// history start year (installation of the E3/DC device)
HISTORY_START_YEAR=2023
// log file for selected topics
TOPIC_LOG_FILE=/tmp/rscp2mqtt.history
// selected topics for logging (regular expressions)
TOPIC_LOG=e3dc/history/.*
TOPIC_LOG=e3dc/system/software
// Interval requesting the E3/DC S10 device in seconds (1..10)
INTERVAL=3
// enable PVI requests, default is true
PVI_REQUESTS=true
// number of available PV strings(trackers), default is 2
PVI_TRACKER=2
// enable PM requests, default is true
PM_REQUESTS=true
// use external PM (S10 Mini), default is false
PM_EXTERN=false
// enable DCB (details for battery modules) requests, default is true
DCB_REQUESTS=false
// enable battery SOC limiter, default is false
SOC_LIMITER=true
// Auto refresh, default is false
AUTO_REFRESH=true
// Disable MQTT publish support (dryrun mode)
DISABLE_MQTT_PUBLISH=false
// Wallbox, default is false
WALLBOX=false
// topics to be published in each cycle (regular expressions)
FORCE_PUB=e3dc/.*

In OpenHAB forum I found a hint about too many persites item states leading to performance issues. In fact, I persisted with every change, now every 5 seconds. Surprise: the status of e3dc/mode change way less now. From every few seconds to twice in 30min:
2023-12-17 12:06:45.129 [INFO ] [b.automation.script.ui.E3DC_Notstrom] - E3DC Notstrombetrieb bereit. Status="1"
2023-12-17 12:06:46.675 [INFO ] [b.automation.script.ui.E3DC_Notstrom] - E3DC Notstrombetrieb nicht aktiv. Status="2"

Any idea, how to deeper understand this behaviour? The E3DC shows stable status

After some investigation ....
rscp2mqtt works fine, the issue was in understanding this back and forth between states.
Rough explanation I dervice from diagrams ... the PV power consumption + available battery power was too high to allow emergency power. That´s why it switched.


text:
Fixed Immortals weapon handling in #70

Fixes a minorly annoying issue where BS2TTS doesn't handle Immortals weapon upgrades on the entire unit but rather just one model.
I know pretty much nothing about Haskell so double check all of my work here.
Thanks!

@pwestling Anything I can do to help get this one merged?

This should be deployed now. Sorry again for all the delays, and thank you so much!

authors: mikeporterdev pwestling

repo: pwestling/battlescribe-roster-parser


text:
Added Travis CI build support.

Hi,
I feel insecure when I issue pull request to project without CI build :) . Can you add SilverWare to Travis CI?
The travis.sh script is a hack around the limit of the output the build can produce on Travis.
Cheers!

Originally, I was more in favor of using Jenkins like we do for PerfCake (https://perfcake.ci.cloudbees.com/). But this is not yet working. I am not against learning something new. Could you take care of it please? Also, note that the tests does not work completely beacause of https://github.com/px3/SilverWare/issues/16

With the build failing at CI I can try to fix it :) .

You only have to log into the Travis CI site using your github account and check the "ON" box on the project. That's all :) . I've configured the rest.

authors: hekonsek marvec


text:
Enhancement: warn about unobserved graph variables in causal_model.identify_effect.

Closes #810.
Introduces a UserWarning that is emitted if there are any graph variables that are not contained in the observed data (self._data). Adds a unit test for this implementation.
Currently, the return values of self.get_common_causes(), self.get_instruments() and self.get_effect_modifiers() are considered as graph variables.
In issue thread #810 there is also a suggestion to point out potential misspellings, for which I'd be happy to amend additional logic. See the questions in the last bullet point below to clarify the implementation in case we wish to add this.
Design considerations and questions to reviewers:

Should we emit this via self.logger.warning instead? In my opinion, this will frequently point out improper usage (e.g., a typo in the columns of self._data) and hiding it in logging output that is not visible by default may not be desirable. But I'm open to suggestions.
Should this consider any other definition of graph variables than the one given above?
On handling misspellings (e.g., graph variable "AGE" vs data variable "AEG"): this would ideally use Levenshtein distance (e.g., with edit distance 1) to determine candidates. There are two options: using an external library (e.g., https://github.com/maxbachmann/Levenshtein) or a helper function. Which option is preferable? In case of a helper function, where would we best define it?

Many thanks in advance for your help in pushing this feature across the finish line :)
Best,
MFreidank

Hi @MFreidank thanks for this PR, this is great!
I answered some of your questions in the code review.
Regarding handling misspellings:  If there's a simple external, MIT-license-compatible library that doesn't pull in other dependencies, that'd be great.  Otherwise, an internal helper function under the utils directory would be great.  Looking at the py files there, I don't see a good home for it.  I'd suggest creating a new string util py file if you go this direction.  I'd classify this as a "nice to have" though, and wouldn't let it slow down the rest of the PR.
A separate question: do the check and warnings for unobserved variables belong in the identification stage, or earlier when the CausalModel is being initialized? since that's when the graph and dataframe are first brought together.  @amit-sharma any thoughts about this?

Regarding the failing checks in the automated build, please take a look at the docs here for additional information on the formatting and DCO check.  https://github.com/py-why/dowhy/blob/main/docs/source/contributing/contributing-code.rst
For the DCO check, you can also follow the instructions on the "details" link to resolve.

Regarding the failing checks in the automated build, please take a look at the docs here for additional information on the formatting and DCO check. https://github.com/py-why/dowhy/blob/main/docs/source/contributing/contributing-code.rst
For the DCO check, you can also follow the instructions on the "details" link to resolve.

I've addressed all other points but this one in my commits. Regarding the checks, I'll have a look tomorrow and clean it up.
In the meantime don't hesitate to suggest any additional changes on top of the updated code state.

Hi @MFreidank thanks for this PR, this is great!
I answered some of your questions in the code review.
Regarding handling misspellings: If there's a simple external, MIT-license-compatible library that doesn't pull in other dependencies, that'd be great. Otherwise, an internal helper function under the utils directory would be great. Looking at the py files there, I don't see a good home for it. I'd suggest creating a new string util py file if you go this direction. I'd classify this as a "nice to have" though, and wouldn't let it slow down the rest of the PR.
A separate question: do the check and warnings for unobserved variables belong in the identification stage, or earlier when the CausalModel is being initialized? since that's when the graph and dataframe are first brought together. @amit-sharma any thoughts about this?

I'll have a look tomorrow to estimate how much additional work it would be to suggest candidate spelling issues.
We could even consider a second "mini-PR" to introduce this functionality (if we don't want to hold this one up from being merged). Unfortunately levenshtein and libraries that derive from it won't be MIT compatible, so a small custom function (potentially using difflib.close_matches) will probably be necessary.
As to where to place the checks, earlier is proabably better. Unless there's a good reason why delaying the checks may be more useful (e.g., if there is a common usage pattern to append data columns before identifying effects or the like, which I'm at least not aware of).

I'll have a look tomorrow to estimate how much additional work it would be to suggest candidate spelling issues. We could even consider a second "mini-PR" to introduce this functionality (if we don't want to hold this one up from being merged). Unfortunately levenshtein and libraries that derive from it won't be MIT compatible, so a small custom function (potentially using difflib.close_matches) will probably be necessary.

Yes, I think doing this as separate PRs makes sense.

As to where to place the checks, earlier is probably better. Unless there's a good reason why delaying the checks may be more useful (e.g., if there is a common usage pattern to append data columns before identifying effects or the like, which I'm at least not aware of).

Then let's insert these checks into the CausalModel init function.
I'd actually recommend implementing the check as a separate function in CausalModel (can be a private), and call that function from inside the init function.  As it is, the init function is too long already.

@emrekiciman I've made the following changes:

undid the accidental whitespace changes (build should not fail anymore)
moved logic into two helper functions defined at the very bottom of the module dowhy.causal_model
call these helper functions directly from __init__ (vs as previously from identify_effect)

Before merging I would still like to:

Clean up the commit history into a single commit with a clean description of this enhancement
Ensure this commit also has the sign-off information

Please let me know if this looks ready to clean up and merge.

@emrekiciman I've consolidated the changes into a single commit with proper signoff information and DCO check passed.
Thank you for your help in finalising this :)

@all-contributors please add @MFreidank for code

Hi @MFreidank @emrekiciman : I am not sure if it helps a lot to print all variables that are not used.
In most settings I am familiar with, there are a huge number of variables that are not used. Are you sure you want to print them out by default?

good point. That hasn't been the case for me.  That just speaks to variety or breadth of usage scenarios. We could update with a check on the number of variables or change the logging level.

authors: Klesel MFreidank emrekiciman

repo: py-why/dowhy


text:
Improve and maintain m-separation function

Signed-off-by: Jaron Lee jaron2005@gmail.com

Fixes #43, #44
Changes proposed in this pull request:

Implemented support for m-separation with undirected edges
Fixed a bug in MixedEdgeGraph with only bidirected edges, where incorrect m-separation statements were being returned
General refactoring and rewriting of documentation for improved clarity

Before submitting

[X] I've read and followed all steps in the Making a pull request
section of the CONTRIBUTING docs.
[X] I've updated or added any relevant docstrings following the syntax described in the
Writing docstrings section of the CONTRIBUTING docs.
[X] If this PR fixes a bug, I've added a test that will fail without my fix.
[X] If this PR adds a new feature, I've added tests that sufficiently cover my new functionality.

After submitting

[ ] All GitHub Actions jobs for my pull request have passed.

Codecov Report

Merging #46 (ddd8faf) into main (21b4f90) will increase coverage by 0.45%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main      #46      +/-   ##
==========================================
+ Coverage   68.45%   68.90%   +0.45%
==========================================
  Files          27       27
  Lines        2000     2029      +29
  Branches      482      497      +15
==========================================
+ Hits         1369     1398      +29
  Misses        526      526
  Partials      105      105

Impacted Files
Coverage Δ

..._graphs/networkx/algorithms/causal/m_separation.py
100.00% <100.00%> (ø)

pywhy_graphs/algorithms/pag.py
74.68% <0.00%> (+0.53%)
:arrow_up:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

Thanks @jaron-lee !

authors: adam2392 codecov-commenter jaron-lee

repo: py-why/pywhy-graphs


text:
Fix fit of ElectrodeSelection and complete tests

Solves #165 @vpKumaravel and completes tests.
The problem is that ElectrodeSelection can be called with y=None, but not MDM.
It is fixed adding this before calling MDM from ElectrodeSelection :
if y is None:
    y = np.ones((X.shape[0]))

Thanks @qbarthelemy

@agramfort : regarding the lengthy list of new features and bug fixes, can you create the release pyRiemann 0.2.8 ?

@qbarthelemy you want me to cut a new release on pypi?

Yes, please!

authors: agramfort qbarthelemy sylvchev

repo: pyRiemann/pyRiemann


text:
Getting CICD ready for release

As the title.

Thank you Robert. Your changes are very reasonable!

@clatapie have a look at this. For learning purposes mainly.

repo: pyansys/ansys-tools-path


text:
disable_rlc_component is not working

Before submitting the issue

[X] I have searched among the existing issues
[X] I am using a Python virtual environment

Description of the bug
I am trying to disable a RLC component. The method returns true but the component still is enabled.
r = edbapp.core_components.disable_rlc_component("C3")
My goal is to disable any component Resistor, Inductor, capacitor, IC, IO, Other. But for now I am using this as this is the only API I could find.

Steps To Reproduce
open EDB
disable a component
Save EDB and open in ansysedt
Which Operating System are you using?
Linux
Which Python version are you using?
3.10
Installed packages
NA

BTW This works but please fix the EDB and also have this feature in EDB
h3d.modeler.components["C1"].enabled = False

@vishak-venkatraman have you tried:
edbapp.core_components.deactivate_rlc_component(component_name)
the disable_rlc_component disable the R, L or C values

@vishak-venkatraman I've added a property is_enabled to the components in Edb with getter and setter

@maxcapodi78
1.
edbapp.core_components.deactivate_rlc_component(component_name)
Is not working. I see a warning but when I open the edb I see them as enabled.
pyaedt WARNING: RLC properties for Component C1 has been assigned.
pyaedt WARNING: RLC properties for Component C2 has been assigned.

I don't see a way in this API to disable only R, or only L or only C from the code
r = edbapp.core_components.disable_rlc_component("C3")
It seems to disable all of them

But even that doesn't work.

@vishak-venkatraman  you are right. There was a bug that I've fixed in 0.6.70. and I've added also the getters and setters
edb.components.instances["C1"].is_enabled = False

Implemented in v0.6.71

repo: pyansys/pyaedt


text:
Fixed Function Issue

Now The Function Will Raise An Error If Wrong Type Is Provided

I'll do so

Added New Lines


text:
Fix donate button not doing anything

The first commit makes it just copy the address to the clipboard.
For the second commit, I tried to add a notification as an exercise to learn more about Pybricks Code :)
It works, but something isn't quite right about this:

I tried to do it the same way as some other alerts are handled, but I don't see this error there.

It works, but something isn't quite right about this:

Since CI is passing, I don't think there is a problem. Sometimes the live checking in VS Code doesn't pick up everything right away.

Updated to resolve open reviews.

Looks great, thanks!

authors: dlech laurensvalk

repo: pybricks/pybricks-code


text:
Why cant i start my project?

?

Discussed in https://github.com/pybricks/support/issues/1179

authors: dlech ihavenoideawhatimdoingh

repo: pybricks/pybricksdev


text:
chore(events/api): make list APIs operate on event-level objects

Types of changes

[x] Bugfix
[x] New feature
[x] Refactoring

WHY
The schedule API returns the id from the event-level model in the response while the other event APIs return the id from the proposal-level model. It makes frontend development harder to associate detail pages to the main schedule page.
HOW
Major:

Make all APIs for retrieving data in the events app operates on event-level models (& return event-level id).
Implement speech API for querying data based on given query parameters or path parameters:

# List Event API
GET /api/events/speeches/?event_types=<event types>

# examples
GET /api/events/speeches/  # list all talk, sponsored, & tutorial events
GET /api/events/speeches/?event_types=tutorial  # list all tutorial events
GET /api/events/speeches/?event_types=talk,sponsored  # list all talk & sponsored events
GET /api/events/speeches/?event_types=wrong  # return 404

# Detail Event API
GET /api/events/speeches/<event_type>/<pk>/

# examples
GET /api/events/speeches/talk/9  # get detail of talk event with pk=9
GET /api/events/speeches/tutorial/1  # get detail of tutorial event with pk=1
GET /api/events/speeches/wrong/2  # return 404
GET /api/events/speeches/talk/wrong  # return 404

Minor:

refactor serializer of event API
fix EventWrapper for handling speaker_name of sponsored event
add a new field of youtube_id for talk event & sponsored event

Codecov Report

Merging #1036 (409d09a) into master (e316aa4) will increase coverage by 0.02%.
The diff coverage is 59.77%.

@@            Coverage Diff             @@
##           master    #1036      +/-   ##
==========================================
+ Coverage   68.55%   68.57%   +0.02%
==========================================
  Files          90       90
  Lines        3520     3523       +3
==========================================
+ Hits         2413     2416       +3
  Misses       1107     1107

Impacted Files
Coverage Δ

src/events/api/urls.py
100.00% <ø> (ø)

src/events/api/views.py
43.71% <47.72%> (+1.02%)
:arrow_up:

src/events/api/serializers.py
65.78% <70.73%> (+0.27%)
:arrow_up:

src/events/models.py
84.90% <100.00%> (+0.19%)
:arrow_up:

src/proposals/models.py
87.50% <0.00%> (-0.79%)
:arrow_down:

Continue to review full report at Codecov.

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

@setmao

The suggested change is applied with modification.
The implementation of get_proposal_serializer_class() is reverted.


text:
Edge Case: class gets changed on pydantic objects init

Checks

[x] I added a descriptive title to this issue
[x] I have searched (google, github) for similar issues and couldn't find anything
[x] I have read and followed the docs and still think this is a bug

Bug
I have made a minimal example based on a problem encountered my codebase at work. I make explicit classes AddOperation, SetOperation, and RemoveOperation. But when putting them in a wrapper model they are all changed to AddOperation because they are structurally the same (except for the Aliases).
requirements.txt
pydantic == 1.9.0

example_minimal.py
import json

from typing import List, Union
from pydantic import BaseModel, Field

class FieldNameBaseModel(BaseModel):
    class Config:
        allow_population_by_field_name = True

class AddOperation(FieldNameBaseModel):
    operation_id: str = Field(..., alias="AddOperationId")

class SetOperation(FieldNameBaseModel):
    operation_id: str = Field(..., alias="SetOperationId")

class RemoveOperation(FieldNameBaseModel):
    operation_id: str = Field(..., alias="RemoveOperationId")

class BulkOperations(FieldNameBaseModel):
    bulk_operations: List[
        Union[
            AddOperation,
            SetOperation,
            RemoveOperation,
        ]
    ] = Field(..., alias="BulkOperations")

def main():

    add_operation = AddOperation(operation_id="item-add")
    set_operation = SetOperation(operation_id="item-set")
    remove_operation = RemoveOperation(operation_id="item-remove")

    bulk_operations = [add_operation, set_operation, remove_operation]

    direct_instantiation = BulkOperations(bulk_operations=bulk_operations)
    direct_json = direct_instantiation.json(by_alias=True)

    parse_obj_version = BulkOperations.parse_obj(
        {"bulk_operations": [x.dict(by_alias=True) for x in bulk_operations]}
    )
    parsed_json = parse_obj_version.json(by_alias=True)

    print(
        "Direct Method:",
        direct_instantiation,
        "\n->",
        direct_json,
        "\n",
    )
    print(
        "Parsed Method:",
        parse_obj_version,
        "\n->",
        parsed_json,
        "\n",
    )

    assert direct_json == parsed_json

if __name__ == "__main__":
    main()

output of example_minimal.py
Direct Method: bulk_operations=[AddOperation(operation_id='item-add'), AddOperation(operation_id='item-set'), AddOperation(operation_id='item-remove')]
-> {"BulkOperations": [{"AddOperationId": "item-add"}, {"AddOperationId": "item-set"}, {"AddOperationId": "item-remove"}]}

Parsed Method: bulk_operations=[AddOperation(operation_id='item-add'), SetOperation(operation_id='item-set'), RemoveOperation(operation_id='item-remove')]
-> {"BulkOperations": [{"AddOperationId": "item-add"}, {"SetOperationId": "item-set"}, {"RemoveOperationId": "item-remove"}]}

Traceback (most recent call last):
  File "example_minimal.py", line 69, in <module>
    main()
  File "example_minimal.py", line 65, in main
    assert direct_json == parsed_json
AssertionError

Thoughts
This seems to be related to the use of allow_population_by_field_name = True, my three models have the same exact structure. Which means that the first one of the union is taken.
class AddOperation(FieldNameBaseModel):
    operation_id: str = Field(..., alias="AddOperationId")

class SetOperation(FieldNameBaseModel):
    operation_id: str = Field(..., alias="SetOperationId")

class RemoveOperation(FieldNameBaseModel):
    operation_id: str = Field(..., alias="RemoveOperationId")

For me, it was unexpected that when I pass in a RemoveOperation it gets changed to an AddOperation.
I understand this is very much an edge case but I encountered it because I use the same models to parse incoming json (and xml), and construct json to interact with an api.
Another thing we did in our codebase to work around it was to change the structure of the objects, but this makes it a lot less convenient to work with incoming data:
class AddOperation(FieldNameBaseModel):
    add_operation_id: str = Field(..., alias="AddOperationId")

class SetOperation(FieldNameBaseModel):
    set_operation_id: str = Field(..., alias="SetOperationId")

class RemoveOperation(FieldNameBaseModel):
    remove_operation_id: str = Field(..., alias="RemoveOperationId")

So my question is, should something change about how allow_population_by_field_name = True works. Or should my usecase be disallowed somewhere in the library maybe.

Hello, seems I also have same behavior with my snippet below
output:
expected <class '__main__.Eagle'>
actual <class '__main__.Duck'>

from typing import Union
from pydantic import BaseModel

class Duck(BaseModel):
    beak: str
    wings: str

class Eagle(BaseModel):
    beak: int
    wings: int

Bird = Union[Duck, Eagle]

class Zoo(BaseModel):
    bird: Bird

awesome_eagle = Eagle(beak=1, wings=1)
zoo = Zoo(bird=awesome_eagle)

print(f"expected {type(awesome_eagle)}\nactual {type(zoo.bird)}")

Workaround: add fields like type: Literal["Eagle"] = "Eagle" to every type

This is a known issue, there are many duplicate issues. It will be fixed in V2.

@samuelcolvin thanks, I'll close this one for now then. Look forward to using V2

repo: pydantic/pydantic


text:
Add Automatic Updates for Computed_Fields

Initial Checks

[X] I have searched Google & GitHub for similar requests and couldn't find anything
[X] I have read and followed the docs and still think this feature is missing

Description
Hello Pydantic developers,
I would like to propose the addition of automatic updates for computed_fields in Pydantic. Currently, if a computed_field depends on other fields that may change over time, we need to manually clear the cache to ensure that the computed_field is updated with the latest values. This can be cumbersome and error-prone, especially if multiple computed_fields are involved.
from pydantic import BaseModel, computed_field

class Rectangle(BaseModel):
    width: int
    length: int

    @computed_field
    @cached_property
    def area(self) -> int:
        # LONG TIME CALC
        return self.width * self.length

rect = Rectangle(width=10, length=20)
print(rect.area)
rect.width = 100
print(rect.area)

I suggest adding a feature that automatically updates computed_fields whenever their dependencies change. This behavior is similar to what MobX provides. With this addition, Pydantic users would no longer need to worry about manual cache clearing, thus simplifying their code and reducing the likelihood of bugs.
from pydantic import BaseModel, computed_field

class Rectangle(BaseModel):
    width: int
    length: int

    @cached_computed_field(depends=["width", "length"]) # Or detect depends automatically by read code_str ?
    def area(self) -> int:
        # LONG TIME CALC
        return self.width * self.length

rect = Rectangle(width=10, length=20)
print(rect.area)
rect.width = 100 # Auto clean rect.area cache
print(rect.area) # rerun area method

I believe this feature would greatly enhance Pydantic's usability and make it even more powerful for building data models. Thank you for your consideration, and please let me know if there are any questions or concerns.
Best regards
Affected Components

[ ] Compatibility between releases
[X] Data validation/parsing
[X] Data serialization - .model_dump() and .model_dump_json()
[ ] JSON Schema
[ ] Dataclasses
[ ] Model Config
[ ] Field Types - adding or changing a particular data type
[ ] Function validation decorator
[ ] Generic Models
[X] Other Model behaviour - model_construct(), pickling, private attributes, ORM mode
[ ] Plugins and integration with other tools - mypy, FastAPI, python-devtools, Hypothesis, VS Code, PyCharm, etc.

Hm, I wasn't aware of the caching. This would definitely be an important feature for my usage. I would use computed fields mainly for implementing the typical getter/setter thing and not for actual computation. I have models where multiple attributes need to be changed when one is updated. The logic to update should be inside the model class itself. I really miss python properties in pydantic v1 right now :/

Hm, I wasn't aware of the caching. This would definitely be an important feature for my usage. I would use computed fields mainly for implementing the typical getter/setter thing and not for actual computation. I have models where multiple attributes need to be changed when one is updated. The logic to update should be inside the model class itself. I really miss python properties in pydantic v1 right now :/

To be clear if I'm not mistaken computed_field does not implement any caching by default, unless @cached_property is used.

Hm, I wasn't aware of the caching. This would definitely be an important feature for my usage. I would use computed fields mainly for implementing the typical getter/setter thing and not for actual computation. I have models where multiple attributes need to be changed when one is updated. The logic to update should be inside the model class itself. I really miss python properties in pydantic v1 right now :/

To be clear if I'm not mistaken computed_field does not implement any caching by default, unless @cached_property is used.

I deleted my comment, apologies for polluting your request

Hm, I wasn't aware of the caching. This would definitely be an important feature for my usage. I would use computed fields mainly for implementing the typical getter/setter thing and not for actual computation. I have models where multiple attributes need to be changed when one is updated. The logic to update should be inside the model class itself. I really miss python properties in pydantic v1 right now :/

To be clear if I'm not mistaken computed_field does not implement any caching by default, unless @cached_property is used.

I deleted my comment, apologies for polluting your request

no worries + that wasn't my feature request ;)

I'm not sure exactly how complex your real world code is, but maybe this can help:
from functools import cached_property
from typing import Any

from pydantic import BaseModel, ConfigDict, ValidatorFunctionWrapHandler, computed_field, model_validator

class Rectangle(BaseModel):
    width: int
    length: int

    model_config = ConfigDict(validate_assignment=True)

    @computed_field
    @cached_property
    def area(self) -> int:
        # LONG TIME CALC
        return self.width * self.length

    @model_validator(mode='wrap')
    @classmethod
    def val_model(cls, value: Any, handler: ValidatorFunctionWrapHandler) -> Any:
        if isinstance(value, Rectangle):
            width, length = value.width, value.length
            value: Rectangle = handler(value)
            new_width, new_length = value.width, value.length
            if new_width != width or new_length != length:
                del value.area
            return value
        return handler(value)

rect = Rectangle(width=10, length=20)
assert rect.area == 200
rect.width = 100
assert rect.area == 2000

I don't think Pydantic can do much more than that, it would get complicated to track dependencies between fields. Cache invalidation is a hard problem. The above should enable you to do that, you'll just have to implement that yourself.

Closing this, as we're not planning to add changes to this behavior.

authors: Haskely Viicos adriangb orfisko sydney-runkle


text:
Defaultdict with set does not work

Initial Checks

[X] I confirm that I'm using Pydantic V2

Description
I cannot define an attribute with a defaultdict using a set. list works perfectly fine.
Example Code
from collections import defaultdict
from typing import DefaultDict, Set

from pydantic import BaseModel

class Test_Set(BaseModel):
    test_dict: DefaultDict[str, Set] = defaultdict(set)

# pydantic.errors.PydanticSchemaGenerationError: Unable to infer a default factory for with keys of type typing.Set.
# Only tuple, set, dict, list, bool, int, float, frozenset, str are supported, other types require an explicit default factory set using `DefaultDict[..., Annotated[..., Field(default_factory=...)]]

Python, Pydantic & OS Version
pydantic version: 2.1.
pydantic-core version: 2.4.0
pydantic-core build: profile=release pgo=true mimalloc=true
install path: /venv/lib/python3.11/site-packages/pydantic
python version: 3.11.0rc1 (main, Aug 12 2022, 10:02:14) [GCC 11.2.0]
platform: Linux-5.19.0-46-generic-x86_64-with-glibc2.35
optional deps. installed: ['email-validator', 'typing-extensions']

Selected Assignee: @samuelcolvin

Thanks @orfisko  for reporting this issue 🙏
I've created a PR to fix it.

@hramezani you're welcome, thanks for picking it up this quickly!

Thanks @orfisko for reporting.

authors: hramezani orfisko


text:
ValidationError when using Generic constructor for subfield

Initial Checks

[X] I confirm that I'm using Pydantic V2

Description
Encountered ValidationError while migrating a codebase from Pydantic v1 to v2. Identified the problem to be from a generic BaseModel constructor, which works on v1 but not v2.
Example code below is a simplified version of the problematic use case in the current codebase.
Wondering if there are any solutions or workarounds with minimal changes, ideally without having to define additional classes, as that will cause large amounts of code redundancy in the codebase.
Example Code
from typing import Generic, TypeVar
from pydantic import BaseModel

A = TypeVar("A")

class Box(BaseModel, Generic[A]):
    value: A | None = None

class Storage(BaseModel):
    int_box: Box[int]

class BoxMaker(Generic[A]):
    @staticmethod
    def make_box() -> Box[A]:
        return Box[A]()

int_box = BoxMaker[int].make_box()
store = Storage(int_box=int_box)

print(store.dict())

Python, Pydantic & OS Version
pydantic version: 2.7.1
        pydantic-core version: 2.18.2
          pydantic-core build: profile=release pgo=false
               python version: 3.10.11 (v3.10.11:7d4cc5aa85, Apr  4 2023, 19:05:19) [Clang 13.0.0 (clang-1300.0.29.30)]
                     platform: macOS-14.4.1-x86_64-i386-64bit

@FizzyAgent,
Thanks for reporting this. I know this issue has been reported before, but I'm still digging around to find it.
In the meantime, here's a similar issue: https://github.com/pydantic/pydantic/issues/8071.

Other related issues:

https://github.com/pydantic/pydantic/issues/9295
https://github.com/pydantic/pydantic/issues/7096#issuecomment-1678031081
https://github.com/pydantic/pydantic/issues/9414

Going to mark this as a duplicate and closer for now, but definitely something we'll want to revisit for V3. Great articulation of the issue!

authors: FizzyAgent sydney-runkle


text:
Model with variadic generics raise a TypeError

Initial Checks

[X] I confirm that I'm using Pydantic V2

Description
This may be related to #5804. Currently, creating a model with variadic generics and several type parameters raise an exception like TypeError: Too many parameters for <class '__main__.Foo'>; actual 3, expected 1:
Example Code
import typing
import pydantic

Things = typing.TypeVarTuple("Things")

class Foo(pydantic.BaseModel, typing.Generic[*Things]):
    ...

Foo[int, str, bool]

Python, Pydantic & OS Version
pydantic version: 2.7.4
        pydantic-core version: 2.18.4
          pydantic-core build: profile=release pgo=true
                 install path: /home/eloi/.cache/pypoetry/virtualenvs/scim2-models-TH2HRh4a-py3.12/lib/python3.12/site-packages/pydantic
               python version: 3.12.4 (main, Jun  7 2024, 06:33:07) [GCC 14.1.1 20240522]
                     platform: Linux-6.9.6-arch1-1-x86_64-with-glibc2.39
             related packages: pydantic-settings-2.3.3 typing_extensions-4.12.2
                       commit: unknown

Hi @azmeuk,
Thanks for the request! Indeed, related to #5804. We currently have the necessary infrastructure for this support this in pydantic-core, but not yet in pydantic. I'm going to close this as a duplicate of #5804.
I do think this is something worth supporting - I'll mark as help wanted in case anyone is interested in picking this up before I get around to it!

authors: azmeuk sydney-runkle


text:
Check whether google analytics results contain sampled data

Had a preview issue where the summary of returned results don't match the google analytics web portal results. This is probably why.
Need to look at the top level element for "containsSampledData".
https://developers.google.com/analytics/devguides/reporting/core/v3/reference#sampling
in pandas.io.ga.GDataReader.get_data, there’s the _read nested function which contains a call to execute the query object from google’s library. Pandas is looking for the results in the ‘rows’ attribute, I bet containsSampledData is also in there.

closing as deprecating ga in #11308

authors: changhiskhan jreback

repo: pydata/pandas


text:
BUG/API: QuarterBegin n=0 #11406

closes #11406 - makes QuarterBegin for n=0 match Month/Year.
xref #11427 - once this is merged the failures there should pass - there is also a little more documentation about general offset semantics in that PR.

cc @cancan101
cc @seth-p
look ok to you?

Looks fine to me,  though I don't recall ever commenting on offsets.
On Dec 7, 2015, at 1:24 PM, Jeff Reback <notifications@github.commailto:notifications@github.com> wrote:
cc @cancan101https://github.com/cancan101
cc @seth-phttps://github.com/seth-p
look ok to you?

Reply to this email directly or view it on GitHubhttps://github.com/pydata/pandas/pull/11777#issuecomment-162493690.

From #8435 does this now return something sensible?
pd.Timestamp('11/2/2012', tz='US/Eastern') + pd.tseries.offsets.QuarterBegin()
Out[29]: Timestamp('2012-12-01 00:00:00-0500', tz='US/Eastern')
pd.Timestamp('11/2/2012', tz='US/Eastern') + pd.tseries.offsets.QuarterEnd()
Out[30]: Timestamp('2012-12-31 00:00:00-0500', tz='US/Eastern')

cc @MichaelWS

Looks sensible to me

@rockg I believe that @chris-b1 next PR, #11370 wiill address that (and is dependent on this PR)

merged via https://github.com/pydata/pandas/commit/56fd4e34a1d8ec8e82bcaa37ba0237ec94431834
thanks!

authors: MichaelWS chris-b1 jreback rockg seth-p


text:
xarray version on windows

What happened?
(xarray-tests) C:\Users\harsh\xarray>python

import xarray
xarray.version
'0.1.dev4684+geceec5f'

What did you expect to happen?
The actual version of xarray is 2023. something, but when doing on Windows this is the output shown everytime
Minimal Complete Verifiable Example
No response
MVCE confirmation

[ ] Minimal example — the example is as focused as reasonably possible to demonstrate the underlying issue in xarray.
[ ] Complete example — the example is self-contained, including all data and the text of any traceback.
[ ] Verifiable example — the example copy & pastes into an IPython prompt or Binder notebook, returning the result.
[ ] New issue — a search of GitHub Issues suggests this is not a duplicate.

Relevant log output
No response
Anything else we need to know?
No response
Environment

@harshitha1201, how did you install it?
if you are installing it from a git clone, can you try
git fetch --all

followed by re-installing it
python -m pip install -e .
python -c "import xarray as xr; xr.show_versions()"

@harshitha1201, how did you install it?
if you are installing it from a git clone, can you try
git fetch --all

followed by re-installing it
python -m pip install -e .
python -c "import xarray as xr; xr.show_versions()"

traceback.txt

Looks like no tags are fetched. Try fetching with --tags added.

Looks like no tags are fetched. Try fetching with --tags added.

(xarray-docs) C:\Users\harsh\xarray>git fetch --tags
(xarray-docs) C:\Users\harsh\xarray>python
Python 3.10.12 | packaged by conda-forge | (main, Jun 23 2023, 22:34:57) [MSC v.1936 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

import xarray
xarray.version
'0.1.dev4684+geceec5f'

I'm able to see the entire code in my code editor. The only thing is the version is shown wrong.

Error while doing make html
Uploading traceback.txt…

repo: pydata/xarray


text:
Minimize duplication in map_blocks task graph

[x] Closes #8409
[ ] Tests added
[ ] User visible changes (including notable bug fixes) are documented in whats-new.rst
[ ] New functions/methods are listed in api.rst

cc @max-sixty
print(len(cloudpickle.dumps(da.chunk(lat=1, lon=1).map_blocks(lambda x: x))))
# 779354739 -> 47699827
print(len(cloudpickle.dumps(da.chunk(lat=1, lon=1).drop_vars(da.indexes).map_blocks(lambda x: x))))
# 15981508

This is a quick attempt. I think we can generalize this to minimize duplication.
The downside is that the graphs are not totally embarrassingly parallel any more.
This PR:

vs main:

Thanks a lot @dcherian !
(I don't have enough context to know how severe the change the parallelism is. I do really appreciate that .map_blocks is really simple in concept, and gets around Dask tripping over itself by just making an opaque function and running it lots of times. Possibly we could do the index filtering locally, which would need much more setup time, but retain .map_blocks simplicity...)

Possibly we could do the index filtering locally, which would need much more setup time,

We do filter the indexes. The problem is that the filtered index values are duplicated a very large number of times for the calculation. The duplication allows the graph to be embarassingly parallel.
And then we include them a second time to enable nice error messages.

We do filter the indexes. The problem is that the filtered index values are duplicated a very large number of times for the calculation. The duplication allows the graph to be embarassingly parallel.

Ah right, yes. I confirmed that — the size difference scales by  n_blocks, not n_blocks*index_size, so it must be filtering:

da = xr.tutorial.load_dataset('air_temperature').isel(lat=slice(25 // 2), lon=slice(53 //2))

[ins] In [9]: len(cloudpickle.dumps(da.chunk(lat=1, lon=1).map_blocks(lambda x: x)))
Out[9]: 18688240

[ins] In [10]: len(cloudpickle.dumps(da.chunk(lat=1, lon=1).drop_vars(da.indexes).map_blocks(lambda x: x)))
Out[10]: 3766137

Defer to you on how this affects dask stability...

@fjetter do you think dask/distributed will handle the change in graph topology in the OP gracefully? map_blocks seems to have decent use in the wild to workaround dask scheduling issues, so it would be nice to not break that. Alternatively is there a better way to scatter out the duplicated data?

FWIW this graph seems to be what blockwise constructs for broadcasting:
dask.array.blockwise(
    lambda x,y: x+y,
    'ij',
    dask.array.ones((3,), chunks=(1,)),
    'i',
    dask.array.ones((5,), chunks=(1,)),
    'j',
).visualize()

map_blocks seems to have decent use in the wild to workaround dask scheduling issues, so it would be nice to not break that.

At least if the idea of "working around scheduling issues" is to forcefully flatten the graph to a purely embarrassingly parallel workload, this property is now gone but I believe you are still fine.
I am not super familiar with xarray datasets so I am doing a bit of guesswork here. IIUC this example dataset has three coordinates / indices lat, lon, time which are numpy arrays (always?) that are known to the client / known at graph construction time. IIUC the issue that is being fixed here is that these arrays are being duplicated?
Then there is also the air data variable that is the actual payload. In this situation tihs is also a numpy array but in a realistic one this is a remote data storage, e.g. a zarr file. We want to release these tasks asap.
If this is all correct, then yes, this is handled gracefully by dask (at least with the latest release, haven't checked older ones)
import xarray as xr
from dask.utils import key_split
from dask.order import diagnostics
from dask.base import collections_to_dsk
da = xr.tutorial.load_dataset('air_temperature')

dsk = collections_to_dsk([da.chunk(lat=1, lon=1).map_blocks(lambda x: x)])
diag, _ = diagnostics(dsk)
ages_data_tasks = [
    v.age == 1
    for k, v in diag.items()
    if key_split(k).startswith('xarray-air')
]
assert ages_data_tasks
assert all(ages_data_tasks)

Age refers to the number of "ticks / time steps" this task survives. age=1 means that once data is "produced", i.e. the task is scheduled, it's consumer is scheduled right afterwards such that after one time step this is being released.

Alternatively is there a better way to scatter out the duplicated data?

If those indices are truly always numpy arrays, I would probably suggest to just slice them to whatever size they need for the given task and embed them, keeping the embarrassingly parallel workload. I think I do not understand this problem sufficiently, It feels like I'm missing something.

I think I do not understand this problem sufficiently, It feels like I'm missing something.

Broadcasting means that the tiny shards get duplicated a very large number of times in the graph. The OP was prompted by a 1GB task graph.

authors: dcherian fjetter max-sixty


text:
Packed encoding of enum still includes variant names for non-unit variants

Test case:
use serde::{Deserialize, Serialize};
use std::io::Write;

#[derive(Debug, Deserialize, Serialize)]
enum Thing {
    Thing1(String),
    Thing2(u64),
    Thing3(Box<[Thing]>),
    Thing4,
}

fn main() -> anyhow::Result<()> {
    let thing = Thing::Thing3(vec![Thing::Thing2(42), Thing::Thing4].into_boxed_slice());
    let v = serde_cbor::ser::to_vec_packed(&thing)?;
    std::fs::File::create("cbor")?.write_all(&v)?;
    Ok(())
}

Hex dump of the resulting file:
00000000  a1 66 54 68 69 6e 67 33  82 a1 66 54 68 69 6e 67  |.fThing3..fThing|
00000010  32 18 2a 03                                       |2.*.|

Notice that it includes Thing3 and Thing2, but not Thing4.
From what I can tell, the serialization of unit variants pays attention to self.packed, but the serialization of non-unit variants does not.

I've created a bugfix for this issue (#215) but I don't have high hopes to get it merged given that this project is effectively unmaintained (see #179).
Feel free to use the bugfix repo directly if it fits your use case.

repo: pyfisch/cbor


text:
Drawing fails on Google Colab

I used the follow in Google colab notebook
!pip install clifford
!pip install pyganja

from clifford.tools.g3c import random_line
from pyganja import *

draw([random_line() for i in range(10)])

And I get the follow error
/usr/local/lib/python3.6/dist-packages/pyganja/__init__.py:2: UserWarning: Failed to import cef_gui, cef functions will be unavailable
  from .script_api import *
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-4-a7564f120d39> in <module>()
      2 from pyganja import *
      3
----> 4 draw([random_line() for i in range(10)])

3 frames
/usr/local/lib/python3.6/dist-packages/pyganja/script_api.py in _to_scene_string(objects)
    256     if isinstance(objects, list):
    257         sc = GanjaScene()
--> 258         sc.add_objects(objects, color=color, static=static)
    259         return str(sc)
    260     elif isinstance(objects, str):

NameError: name 'color' is not defined

Ah yes, this was fixed in this commit but looks like we haven't done a release in a while. We will do one very shortly, in the meantime install from master will be a work around for this bug, try changing that line to:
!pip install git+https://github.com/pygae/pyganja.git

On google collab however I am still not getting any output although there is no error, I've started looking into that but I suspect it may be to do with outputting javascript into collab which, like jupyter lab, it probably won't like

Changing the test to:
!pip install git+https://github.com/pygae/pyganja.git
!pip install clifford

from clifford.tools.g3c import random_line, layout
from pyganja import *

gs = GanjaScene()
js = generate_notebook_js(gs, sig=layout.sig)
print(js)

import IPython
display(js)

print('Cell complete')

reproduces the javascript error failure to draw. The cell executes and prints cell complete with no error messages but also no output. In the development console however we get the following error:

Adding the line:
display(IPython.core.display.HTML('''<script src="/static/components/requirejs/require.js"></script>'''))

gets rid of the requirejs error but still no output visible in colab

@timcash I have just triggered a release so the version in pypi should now be equal with master https://pypi.org/project/pyganja/0.0.13/

Wonderful

I am facing the same problem: installed node.js and pyganja v0.015 on mac. Clifford working well.
UserWarning: Failed to import cef_gui, cef functions will be unavailable from .script_api import *
running the code below:
from clifford.tools.g3c import *
from pyganja import *
object_array = [
random_conformal_point(),
random_point_pair(),
random_circle(),
random_line(),
random_sphere(),
random_plane()
]
The simplest way to use pyganja
draw(object_array,
static=False ,
scale=0.1)

authors: hugohadfield jmizaret timcash

repo: pygae/pyganja


text:
Haskell import highlighting bug

(Original issue 658 created by None on 2011-04-13T06:55:00.244025+00:00)
in the following code:
{{{
#!haskell
import Example
(example)
}}}
"example" is erroneously highlighted.

(Original issue 658 last updated on 2012-02-06T06:50:28.428232+00:00)
(Issue automaticaly closed due to status in Bitbucket: resolved)

(Original comment by birkenfeld on 2012-02-06T06:50:28.420438+00:00)
Looks good to me in latest tip.

repo: pygments/pygments-migration-test


text:
pigmentize + simplegeneric error in python2.7.9

(Original issue 1312 created by None on 2016-12-03T17:04:22.651943+00:00)
On OSX 10.11.6
$ python --version
Python 2.7.9
$ sudo easy_install Pygments
Password:
Searching for Pygments
Reading https://pypi.python.org/simple/Pygments/
Best match: Pygments 2.1.3
Downloading https://pypi.python.org/packages/b8/67/ab177979be1c81bc99c8d0592ef22d547e70bb4c6815c383286ed5dec504/Pygments-2.1.3.tar.gz#md5=ed3fba2467c8afcda4d317e4ef2c6150
Processing Pygments-2.1.3.tar.gz
Writing /tmp/easy_install-cfJ6Qd/Pygments-2.1.3/setup.cfg
Running Pygments-2.1.3/setup.py -q bdist_egg --dist-dir /tmp/easy_install-cfJ6Qd/Pygments-2.1.3/egg-dist-tmp-6TpRJw
Adding Pygments 2.1.3 to easy-install.pth file
Installing pygmentize script to /usr/local/bin
Installed /usr/local/lib/python2.7/site-packages/Pygments-2.1.3-py2.7.egg
Processing dependencies for Pygments
Finished processing dependencies for Pygments
$ pygmentize -v -o provi/code.pdf  ~/noMirror/newsemex/E45ws/AnnotatorE4/src/annotator/Activator.java

An unhandled exception occurred while highlighting.
Please report the whole traceback to the issue tracker at
https://bitbucket.org/birkenfeld/pygments-main/issues.

Traceback (most recent call last):
File "/usr/local/bin/pygmentize", line 9, in
load_entry_point('Pygments==2.1.3', 'console_scripts', 'pygmentize')()
File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Pygments-2.1.3-py2.7.egg/pygments/cmdline.py", line 504, in main
return main_inner(popts, args, usage)
File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Pygments-2.1.3-py2.7.egg/pygments/cmdline.py", line 355, in main_inner
lexer = get_lexer_for_filename(infn, code, **parsed_opts)
File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Pygments-2.1.3-py2.7.egg/pygments/lexers/init.py", line 147, in get_lexer_for_filename
res = find_lexer_class_for_filename(_fn, code)
File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Pygments-2.1.3-py2.7.egg/pygments/lexers/init.py", line 112, in find_lexer_class_for_filename
for cls in find_plugin_lexers():
File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Pygments-2.1.3-py2.7.egg/pygments/plugin.py", line 53, in find_plugin_lexers
yield entrypoint.load()
File "build/bdist.macosx-10.9-x86_64/egg/pkg_resources.py", line 2252, in load
File "build/bdist.macosx-10.9-x86_64/egg/pkg_resources.py", line 2266, in require
File "build/bdist.macosx-10.9-x86_64/egg/pkg_resources.py", line 761, in resolve
pkg_resources.VersionConflict: simplegeneric 0.8.1 is installed but simplegeneric>0.8 is required by []
$ sudo easy_install --upgrade simplegeneric
Password:
Searching for simplegeneric
Reading https://pypi.python.org/simple/simplegeneric/
Best match: simplegeneric 0.8.1
Processing simplegeneric-0.8.1-py2.7.egg
simplegeneric 0.8.1 is already the active version in easy-install.pth
Using /usr/local/lib/python2.7/site-packages/simplegeneric-0.8.1-py2.7.egg
Processing dependencies for simplegeneric
Finished processing dependencies for simplegeneric
... And the same command pigmentize yields the same error...

This is a problem with other installed packages (which are enumerated to find entry-point lexer plugins); pygments itself does not import simplegeneric.

authors: Anteru birkenfeld

repo: pygments/pygments


text:
C++ if constexpr not recognized (C++17)

(Original issue 1432 created by None on 2018-03-27T05:23:39.987109+00:00)
C++17 if constexpr not recognized.
Those two constexpr should be in the same color.
#!C++
constexpr int max_size = 100;
if constexpr (size > max_size)
    return 1;

(Original comment by fenbf on 2018-12-11T11:54:00.166827+00:00)
another example:
http://pygments.org/demo/6759902/
the first "if constexpr" looks ok, but the second one "else if constexpr" is not recognised properly.
if constexpr is a C++17 feature, and we see more and more code using that. So that error is not a minor thing.
I hope the fix is relatively easy to handle in the parser.

Doesn't reproduce in the latest version, closing.