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

Improve tutorial #39

Open
EvgSkv opened this issue Apr 17, 2021 · 12 comments
Open

Improve tutorial #39

EvgSkv opened this issue Apr 17, 2021 · 12 comments

Comments

@EvgSkv
Copy link
Owner

@EvgSkv EvgSkv commented Apr 17, 2021

I am very curious about experience of newcomers with the tutorial. I am sure it can be improved to make onboarding easier.

@TimKam
Copy link

@TimKam TimKam commented Apr 22, 2021

Is it possible to write Python extensions for Logica?
For example, can one define a Python function in a Colab/Jupyter notebook and then specify an interface to make this function accessible in Logica?

@EvgSkv
Copy link
Owner Author

@EvgSkv EvgSkv commented Apr 22, 2021

@TimKam, this functionality is not exposed now, but this is something that is natural to add.

It would be quite easy to add annotation-plug-ins. For example we can let a user write a function that renders a result of a predicate as a graph. Then they could write a program

G("a", "b");
G("b", "c");
G("c", "d");
G("d", "a");
G("d", "e");

@RenderGraph(G, "/path/to/graph.html");

And when this program runs the HTML file has rendering of the graph a - b - c - d - a, d - e.

I think it's much more tricky to add ability to call python functions from Logica. Like the user defining:

def F(x):
  return 2 * x;

and then having Logica program

Q(F(5));

resulting in Q having a row col0: 10
This is because Logica's engine is a database and BigQuery surely doesn't have python support, I am not sure about psql.

Could you tell a little bit about usecase that you had in mind?

@TimKam
Copy link

@TimKam TimKam commented Apr 22, 2021

Thank you for the prompt response. In my particular case I want to take a directed graph, process it in Python and return the result back to Logica. I am not sure if this is your "easy" or "tricky" case: in your "easy" case, could one write the result back to Logica? Edit: Should we move to a new ticket?

@EvgSkv
Copy link
Owner Author

@EvgSkv EvgSkv commented Apr 23, 2021

We should have started the discussion in a separated ticket or in a discussion section :-) But as it's already going here, let's get to the bottom of it and then create an appropriate issue.

This seems somewhere in the middle between "easy" and "tricky".
Should the input of your function be coming from Logica, or from outside?

@TimKam
Copy link

@TimKam TimKam commented Apr 23, 2021

The input should also come from Logica. So it would be Logica -> Python (for example) -> Logica.

@EvgSkv
Copy link
Owner Author

@EvgSkv EvgSkv commented Apr 23, 2021

@TimKam, I've created an issue #55 for this. Please take a look and let me know what you think about it.

@atqnp
Copy link

@atqnp atqnp commented Jun 6, 2021

@EvgSkv
Thank you very much for your work!
Sorry if these already been explained in the tutorial.
I wanted to ask about some of my use case and I think it should also be included here so it may be added in future tutorial. For now only these came to mind.

  1. Filtering boolean column. I am unable to filter a column of true or false. How do I write to filter a column with boolean data?
  2. LIKE - How do I write to filter only a part of known string in SQL?
@EvgSkv
Copy link
Owner Author

@EvgSkv EvgSkv commented Jun 7, 2021

@atqnp
Thank you for supportive feedback and questions!
I've updated tutorial with the answers.
Let me know if further clarification is needed.

@evelynmitchell
Copy link

@evelynmitchell evelynmitchell commented Jun 25, 2021

You use Z in the tutorial in what feels to me like a confusing way.

It is first introduced as an alias for the Integers, and then is re-introduced as a subset of the integers.

But Z is not a builtin equivalent to the Integers, it's just a variable name.

@evelynmitchell
Copy link

@evelynmitchell evelynmitchell commented Jun 25, 2021

The colab notebooks assumes you have access to a BigQuery project "YOUR_PROJECT":
BadRequest: 400 POST https://bigquery.googleapis.com/bigquery/v2/projects/YOUR_PROJECT/jobs: Invalid project ID 'YOUR_PROJECT'. Project IDs must contain 6-63 lowercase letters, digits, or dashes. Some project IDs also include domain name separated by a colon. IDs must start with a letter and may not end with a dash.

What would be a better default name, for someone who doesn't normally run BigQuery out of colab?

@evelynmitchell
Copy link

@evelynmitchell evelynmitchell commented Jun 25, 2021

Typo
querries should be queries.
Inifinite should be Infinite

@EvgSkv
Copy link
Owner Author

@EvgSkv EvgSkv commented Jun 29, 2021

@evelynmitchell Thanks for feedback! I agree with these comments and is thinking how to address them.

What would be a better default name, for someone who doesn't normally run BigQuery out of colab?
You need your own GCloud project to run BigQuery query. However Logica can run on SQLite, so I plan to adjust tutorial to leverage that and make it easier for users who don't have a GCloud project.

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

Successfully merging a pull request may close this issue.

None yet
4 participants