-
Notifications
You must be signed in to change notification settings - Fork 32
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
[DOC] added basic examples to works with docsrv #59
Conversation
@mcarmonaa if you use the python wrapper branch the issue with the guava dependencies is fixed |
Codecov Report
@@ Coverage Diff @@
## master #59 +/- ##
=========================================
Coverage 85.07% 85.07%
Complexity 66 66
=========================================
Files 18 18
Lines 563 563
Branches 100 100
=========================================
Hits 479 479
Misses 36 36
Partials 48 48 Continue to review full report at Codecov.
|
}, | ||
"outputs": [], | ||
"source": [ | ||
"repositoriesDf = spark.read.format(\"tech.sourced.api\").option(\"table\",\"repositories\").load(\"/repositories\")\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is an updated version of this notebook inside the python wrapper branch that uses the python wrapper
@@ -0,0 +1,178 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer to have all the notebooks in one place. Notebooks are executables, so in this case it should be in the examples folder. Putting them all into the same place we avoid duplication and we can handle api changes better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the moment this file is duplicated here because of docsrv
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ajnavarro @mcarmonaa Could it be an alternative to put them wherever they should be, and then update the _examples/README.md
link? I mean: point to the original one, instead of pointing to a copy.
(it should fix the problem of the duplication)
If you prefer to use a copy, I'd use a symbolic link to maintain the synchronicity
I've just added examples of |
@@ -0,0 +1,32 @@ | |||
```bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about adding title and a brief explanation of what is gonna happen in the snippet below at the start of each of these markdown files?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -0,0 +1,38 @@ | |||
## Classifying languages example | |||
|
|||
This example uses the pyspark-shell to show a basic usage of the UDF `classify_languages()`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we should change UDF, because to someone that's not familiar with Spark it sounds really alien
to show how to classify files by their language
maybe?
@@ -0,0 +1,39 @@ | |||
## Classifying languages and extracting UASTs example | |||
|
|||
The combined usage of both UDFs `classify_languages()` and `extract_uasts()` has the advantage that doesn't rely the language detection task on the [bblfsh server](https://github.com/bblfsh/server) , so you can save some time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
@@ -0,0 +1,41 @@ | |||
## Classifying languages example | |||
|
|||
This example uses the spark-shell to show a basic usage of the UDF `classifyLanguages`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
@@ -0,0 +1,42 @@ | |||
## Classifying languages and extracting UASTs example | |||
|
|||
The combined usage of both UDFs `classifyLanguages` and `extractUASTs` has the advantage that doesn't rely the language detection task on the [bblfsh server](https://github.com/bblfsh/server) , so you can save some time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found problems with absolute links.
You may consider the following example, and apply it in the others.
_examples/README.md
Outdated
|
||
### pyspark | ||
|
||
- [pyspark's shell basic example](https://github.com/src-d/spark-api/blob/master/_examples/pyspark/pyspark-shell-basic.md) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the link is broken.
If you go to the original file:
https://github.com/mcarmonaa/spark-api/blob/feature/docsrv/_examples/README.md
And try it, it fails.
If you change it by the relative format, it seems to work:
- [pyspark's shell basic example](pyspark/pyspark-shell-basic.md)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I'll change the links to the relative format!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many thanks for the documentation and examples!
Shall we merge this? |
I just added a few basic examples for spark, pyspark, and jupyter. I was trying to use
classifyLanguage
andextractUASTs
functionality but they don't work right now, so I didn't add any example about. I'll try to make it work somehow since #57 doesn't work for me.It would be nice if you could suggest other kind of examples to include, based on some usage cases.