import error after upgrade to airflow2.0.2 - airflow

Received an import error after upgrading to airflow2.0.2-python3.7 image. Package seems to be installed, not sure what is causing the issue and how to fix it. Tried to uninstalling and reinstalling the packages but that does not work either.
{providers_manager.py:299} WARNING - Exception when importing 'airflow.providers.google.common.hooks.leveldb.LevelDBHook' from 'apache-airflow-providers-google' package: No module named 'airflow.providers.google.common.hooks.leveldb'
# packages
apache-airflow-providers-google==2.2.0
google-ads==7.0.0
google-api-core==1.26.3
google-api-python-client==1.12.8
google-auth==1.29.0
google-auth-httplib2==0.1.0
google-auth-oauthlib==0.4.4
google-cloud-automl==2.3.0
google-cloud-bigquery==2.13.1
google-cloud-bigquery-datatransfer==3.1.1
google-cloud-bigquery-storage==2.4.0
google-cloud-bigtable==1.7.0
google-cloud-container==1.0.1
google-cloud-core==1.6.0
google-cloud-datacatalog==3.1.1
google-cloud-dataproc==2.3.1
google-cloud-dlp==1.0.0
google-cloud-kms==2.2.0
google-cloud-language==1.3.0
google-cloud-logging==2.3.1
google-cloud-memcache==0.3.0
google-cloud-monitoring==2.2.1
google-cloud-os-login==2.1.0
google-cloud-pubsub==2.4.1
google-cloud-redis==2.1.0
google-cloud-secret-manager==1.0.0
google-cloud-spanner==1.19.1
google-cloud-speech==1.3.2
google-cloud-storage==1.37.1
google-cloud-tasks==2.2.0
google-cloud-texttospeech==1.0.1
google-cloud-translate==1.7.0
google-cloud-videointelligence==1.16.1
google-cloud-vision==1.0.0
google-cloud-workflows==0.2.0

It's a bug (harmless) in definition of the google provider 2.2.0 in fact:
In provider.yaml:
airflow.providers.google.common.hooks.leveldb.LevelDBHook
should be:
airflow.providers.google.leveldb.hooks.LevelDBHook
This was fixed in https://github.com/apache/airflow/pull/15453 and will be available in next version of google provider.

Related

Geomorph not functioning after update

I recently updated my MacBook air (2017) to the Mojave OS and proceeded to update my version of R and Rstudio. Unfortunately, ever since the 'plotTangentSpace' command no longer functions appropriately even when attempting to run the example 'plethodon' code from the Geomorph vingette, I always receive the following error in the output (bolded below):
data(plethodon)
Y.gpa<-gpagen(plethodon$land) #GPA-alignment
|====================================================================================| 100%
gp <- interaction(plethodon$species, plethodon$site)
plotTangentSpace(Y.gpa$coords, groups = gp)
Error in plotTangentSpace(Y.gpa$coords, groups = gp) :
unused arguments (Y.gpa$coords, groups = gp)
I have tried uninstalling and reinstalling R for a MacOS many times including versions 4.0.2, 3.6.3, 3.6.1, and 3.2.1. I have also uninstalled and reinstalled XQuartz several times.
If anyone has encountered a similar issue or has any other ideas I can try I would really appreciate the help. Thank you!
If you execute:
?plotTangentSpace
You should see that this is a deprecated function. That means you should not be using it. It says:
Notes for geomorph 3.3.0 and subsequent versions
I suspect you have not updated your copy of the vignette. There are instructions on the help page for an alternate approach. The example in the help page for the suggested function is:
data(plethspecies)
Y.gpa <- gpagen(plethspecies$land) #GPA-alignment
### Traditional PCA
PCA <- gm.prcomp(Y.gpa$coords)
summary(PCA)
plot(PCA, main = "PCA")
For the plethodon data they suggest:
PCA.w.phylo <- gm.prcomp(Y.gpa$coords, phy = plethspecies$phy)
summary(PCA.w.phylo)
plot(PCA.w.phylo, phylo = TRUE, main = "PCA.w.phylo")
So start a new session (to unload the currently loaded geomorph namespace, and execute this at the r session command line:
install.packages("geomorph")
You should be getting version 3.3.1 of the geomorph package.
I think I found the problem! In my case, the error was due to a old version of the package RRPP, which is required by Geomorph. After updating it, Geomorph is working perfectly! Hope this can be useful for you too.
I came across the same error but after updating the RRPP and rgl packages required for geomorph, the gm.prcomp() function worked for me. I hope this helps if you haven't figured it out already.

How do I deal with an error message while installing a package?

I am brand new to this so please forgive my inexperience...I'm trying to learn.
I'm attempting to install an R package called "Doublet Finder" using the specified code given on the Github site.
When I do this, I get this error immediately:
Error in rbind(info, getNamespaceInfo(env, "S3methods")) :
number of columns of matrices must match (see arg 2)
Being new to R, I'm not sure what this error means and when I google this something similar comes up and the individual removed and re-installed ALL of their libraries...that seems crazy. Does anyone have advice on what this could be, how to fix it, or why the package won't install?
Your problem seems to be fairly similar to this one. It might be the case that the dependencies (packages that Doublet Finder relies on) are outdated. What you can try is to follow these steps to uninstall and reinstall all packages with the hope that by updating packages there isn't a version mismatch.
This code is copied from the website above:
ip <- as.data.frame(installed.packages(lib.loc = .libPaths()[1]),
stringsAsFactors = FALSE)
head(ip)
str(ip)
path.lib <- unique(ip$LibPath)
# create a vector with all the names of the packages you want to remove
pkgs.to.remove <- ip[,1]
head(pkgs.to.remove)
str(pkgs.to.remove)
sapply(pkgs.to.remove, remove.packages, lib = path.lib)
sapply(pkgs.to.remove, install.packages, lib = path.lib)

Error Message R CRAN UPLOAD

Uploading my package on CRAN I got the following error message on the check results page.
See also CHECK PAGE
Check: whether package can be installed
Result: WARN
Found the following significant warnings:
Warning: S3 methods '[.fun_list', '[.grouped_df', 'all.equal.tbl_df', 'anti_join.data.frame', 'anti_join.tbl_df', 'arrange.data.frame', 'arrange.default', 'arrange.grouped_df', 'arrange.tbl_df', 'arrange_.data.frame', 'arrange_.tbl_df', 'as.data.frame.grouped_df', 'as.data.frame.rowwise_df', 'as.data.frame.tbl_cube', 'as.data.frame.tbl_df', 'as.table.tbl_cube', 'as.tbl.data.frame', 'as.tbl.tbl', 'as.tbl_cube.array', 'as.tbl_cube.data.frame', 'as.tbl_cube.matrix', 'as.tbl_cube.table', 'as_data_frame.grouped_df', 'as_data_frame.tbl_cube', 'auto_copy.tbl_cube', 'auto_copy.tbl_df', 'cbind.grouped_df', 'collapse.data.frame', 'collect.data.frame', 'common_by.NULL', 'common_by.character', 'common_by.default', 'common_by.list', 'compute.data.frame', 'copy_to.DBIConnection', 'copy_to.src_local', 'default_missing.data.frame', 'default_missing.default', 'dim.tbl_cube', 'distinct.data.frame', 'distinct.default', 'distinct.grouped_df', 'distinct.tbl_df', 'distinct_.data.frame', 'distinct_.grouped_df', 'dist [... truncated]
Flavor: r-oldrel-windows-ix86+x86_64
Seems to be only relevant for old release windows-ix86+x86_64.
I actually have no clue what this message might mean or how to fix this. Does somebody know more about this problem?

dependent packages not loading in R on Debian

I'm having trouble loading the sde package on a clean Debian install running R 2.11.1. I've seen this behavior with some other packages, however, so I don't think it's specific to only this one package. Here's an example of the conundrum:
>install.packages("sde", lib.loc=libPath)
... installs sde, and the packages it's dependent on: zoo, fda
> library(sde, lib=libPath)
Loading required package: fda
Error: package 'fda' could not be loaded
In addition: Warning message:
In library(pkg, character.only = TRUE, logical.return = TRUE, lib.loc = lib.loc) :
there is no package called 'fda'
ok, that's odd. I saw fda being installed. So I manually load the dependencies:
> library(zoo, lib=libPath)
> library(fda, lib=libPath)
Loading required package: splines
ok, that worked. Now let's try sde:
> library(sde, lib=libPath)
To check the errata corrige of the book, type vignette("sde.errata")
WTF? it loaded fine?!?
So why can I manually load the packages but R is not picking them up automagically?
Adding to my confusion, I discovered during debugging that if I don't use the lib=libPath then everything works just fine. So it looks like the use of a custom path for packages is screwing this all up... but why?
You confirmed my suspicions in the comments. You need to do one of two things:
.libPaths(libPath)
or
library(sde, lib=c(libPath,.libPaths()))
I prefer the first method because the second requires you do that for all calls to library.

rJava classpath in an R package... works on some systems... not others

I have built a package for R that wraps R around some Java classes. On my development laptop (Ubuntu) this package loads properly and works great. On two other machines (one Ubuntu, one Debian) I have tried to use this package and the classpath is not being set by the .jpackage() call.
All three machines are running R 2.12.1 and rJava .8-8 which I believe to be the most recent.
The entire package is up at Google Code but here's the contents of the zzz.R file which works to set the class path on one machine but not others:
##' #import rJava
.onLoad <- function(lib, pkg) {
pathToSdk <- paste(system.file(package = "GSRadR") , "/gsrad_sample/lib/", sep="")
jarPaths <- c(paste(pathToSdk, "clima_core-1.0.0.jar", sep=""),
paste(pathToSdk, "clima_GSRAD-1.0.0.jar", sep=""),
paste(pathToSdk, "colt-1.0.jar", sep=""),
paste(pathToSdk, "commons-lang-2.0.jar", sep=""),
paste(pathToSdk, "junit-3.8.1.jar", sep=""),
paste(pathToSdk, "log4j-1.2.8.jar", sep=""),
paste(pathToSdk, "xqore.jar", sep="")
)
.jpackage(pkg, morePaths=jarPaths)
attach( javaImport( c("java.lang", "java.io")))
packageStartupMessage( paste( "GSRadR loaded. The classpath is: ", paste(.jclassPath(), collapse=" " ) ) )
}
On my laptop this returns the following:
> require(GSRadR)
Loading required package: GSRadR
Loading required package: rJava
GSRadR loaded. The classpath is: /home/jal/R/library/rJava/java /home/jal/R/library/GSRadR/gsrad_sample/lib/clima_core-1.0.0.jar /home/jal/R/library/GSRadR/gsrad_sample/lib/clima_GSRAD-1.0.0.jar /home/jal/R/library/GSRadR/gsrad_sample/lib/colt-1.0.jar /home/jal/R/library/GSRadR/gsrad_sample/lib/commons-lang-2.0.jar /home/jal/R/library/GSRadR/gsrad_sample/lib/junit-3.8.1.jar /home/jal/R/library/GSRadR/gsrad_sample/lib/log4j-1.2.8.jar /home/jal/R/library/GSRadR/gsrad_sample/lib/xqore.jar
But on my other machines it returns only:
> require(GSRadR)
Loading required package: GSRadR
Loading required package: rJava
GSRadR loaded. The classpath is: /usr/lib/R/site-library/rJava/java
Any tips on what might cause the .jpackage() call to work differently on different machines? I've built packages using rJava before and used the same template for the .onLoad() function with no problems.
Edit
So on one of the machines where this was not working, I tried to simply add a path to the class path the "non package" way. And that failed:
> .jaddClassPath("/home/jal/R/x86_64-pc-linux-gnu-library/2.12/GSRadR/gsrad_sample/lib/clima_core-1.0.0.jar")
> .jclassPath()
[1] "/usr/lib/R/site-library/rJava/java"
Um... so I can't add anything to the class path. But why?
Edit II
When I was loading my custom library onto one of the machines that was not working, I was using a temporary library location, like so:
install.packages("/tmp/GSRadR_0.01.tar.gz", lib=/my/path)
then loading the library like this:
require(GARadR, lib=/my/path)
I discovered, through trial and error, that if I remove the lib= bit it would work properly. So why would loading an R package that uses rJava into a custom library location keep the .jaddClassPath() function from working?
I may be able to work around this, but I'd love to know what's causing this odd (at least to me) behavior.
I suspect that the directory or file in the first edit doesn't exist: /home/jal/R/x86_64-pc-linux-gnu-library/2.12/GSRadR/gsrad_sample/lib/clima_core-1.0.0.jar. (Also, are you sure that you want to add that particular file, or the directory?)
Try file.info("/home/jal/R/x86_64-pc-linux-gnu-library/2.12/GSRadR/gsrad_sample/lib/clima_core-1.0.0.jar").
In my case, I tried .jaddClassPath("/willy/wonka") and it didn't work. But when I tried .jaddClassPath("/home/voldemort"), it worked. (Let Java be your horcrux.)

Resources