Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update vignette w non-ASCII chars #170

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

majazaloznik
Copy link
Contributor

Add subsection to the "Things to be careful about" section explaining issues with non-ASCII characters in the db responses. See #165

Copy link
Collaborator

@jonkeane jonkeane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this! I should have looked a bit more closely on the issue (I was distracted by the {bit64} problem, I think!)

I'm curious if maybe this is an encoding issue specific to your database or runners. Do you happen to have an example of a github actions run that failed remotely when it worked locally? We might even be able to resolve this from happening without needing to manually change up fixtures

I just tried the following in a console and these seemed to go fine (I'm on MacOS, and I believe unicode is being used throughout the saving and then reading process).

> dput("😀", file = "foo.R", control = c("all", "hexNumeric"))
> source("foo.R")$value
[1] "😀"
> dput("é", file = "foo.R", control = c("all", "hexNumeric"))
> source("foo.R")$value
[1] "é"
> dput("č", file = "foo.R", control = c("all", "hexNumeric"))
> source("foo.R")$value
[1] "č"
> dput(data.frame(col=c("č", "é", "😀")), file = "foo.R", control = c("all", "hexNumeric"))
> source("foo.R")$value
  col
1   č
2   é
3  😀

@majazaloznik
Copy link
Contributor Author

Here's the offending actions: the one before last (actually at least two if not three) were passing locally but not remotely (sorry for the very descriptive commit messages 😄 ). The last one then passed on both.
It's not the mocks directly that are causing the issue, but it's a second order consequence, when they are used as inputs into other functions.. I think.

The substantive change in the last commit was the manual fix of that one mock file. I also added some print() statements for debugging and here's the output of one of them locally:

# A tibble: 6 x 3
  tab_dim_id level_value level_text                                             
       <int> <chr>       <chr>                                                  
1          2 V           Teko�e cene (mio EUR)                                  
2          2 Y           Stalne cene predhodnega leta (mio EUR)                 
3          2 L           Stalne cene, referen�no leto 2010 (mio EUR)            
4          2 G4          Stopnja rasti obsega glede na enako �etrtletje predhod~
5          2 G1          Stopnja rasti obsega glede na predhodno �etrtletje (%) 
6          2 GO4         Prispevek k rasti obsega BDP glede na enako �etrtletje~

And remotely:

# A tibble: 6 x 3
  tab_dim_id level_value level_text                                             
       <int> <chr>       <chr>                                                  
1          2 V           Tekoče cene (mio EUR)                                  
2          2 Y           Stalne cene predhodnega leta (mio EUR)                 
3          2 L           Stalne cene, referenčno leto 2010 (mio EUR)            
4          2 G4          Stopnja rasti obsega glede na enako četrtletje predhod~
5          2 G1          Stopnja rasti obsega glede na predhodno četrtletje (%) 
6          2 GO4         Prispevek k rasti obsega BDP glede na enako četrtletje~

Locally I'm on a Windows machine and I get this btw:

> dput(data.frame(col=c("č", "é", "😀")), file = "foo.R", control = c("all", "hexNumeric"))
> source("foo.R")$value
           col
1            č
2            é
3 <U+0001F600>

Thanks for taking the time to look into this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants