This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test | |
| on: | |
| push: | |
| branches: [ "master" ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| bq_op = components.load_component_from_file('./bq_to_csv.yaml') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from kfp import components | |
| components.func_to_container_op(bigquery_to_csv, | |
| output_component_file='bq_to_csv.yaml', | |
| #custom Docker image | |
| base_image='gcr.io/demo-project/custom-container', | |
| #dynamically install packages | |
| packages_to_install=['google-cloud-bigquery-storage','google-cloud-bigquery','pandas','pyarrow']) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #a. importing dependencies | |
| from google.cloud import bigquery | |
| import google.auth |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def bigquery_to_csv(filter_param: str ="50"): | |
| #a. importing dependencies | |
| from google.cloud import bigquery | |
| import google.auth | |
| #b. creating credentials | |
| creds, project = google.auth.default() | |
| client = bigquery.Client(project='demo-project', credentials=creds) | |
| #c. preforming query |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public SoldierDBItem getSoldierByName(String name) throws | |
| SQLException { | |
| QueryBuilder<SoldierDBItem, Integer> qb = getSoldierDao().queryBuilder(); | |
| Where where = qb.where(); | |
| where.eq(SoldierDBItem.COLUMN_NAME, name); | |
| SoldierDBItem soldierDBItem = qb.queryForFirst(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import android.content.Context; | |
| import android.database.sqlite.SQLiteDatabase; | |
| import com.j256.ormlite.android.apptools.OrmLiteSqliteOpenHelper; | |
| import com.j256.ormlite.dao.Dao; | |
| import com.j256.ormlite.support.ConnectionSource; | |
| import com.j256.ormlite.table.TableUtils; | |
| import java.sql.SQLException; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import com.j256.ormlite.field.DatabaseField; | |
| import com.j256.ormlite.table.DatabaseTable; | |
| @DatabaseTable(tableName = SoldierDBItem.TABLE_NAME) | |
| public class SoldierDBItem { | |
| public static final String TABLE_NAME = "soldiers"; | |
| // | |
| public static final String COLUMN_ID = "id"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| String body = response.body().string(); | |
| JSONObject jsonObject = new JSONObject(body); |