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

TDL-20219: Add support for JSONL files #40

Open
wants to merge 20 commits into
base: crest-master
Choose a base branch
from

Conversation

hpatel41
Copy link
Contributor

@hpatel41 hpatel41 commented Aug 18, 2022

Description of change

TDL-20219: Add support for JSONL files

  • Added support for JSONL files.

NOTE: This PR has to be merged after the PR #23 of singer-encodings is merged and released. After releasing the new version for the singer-encodings library, we need to update the singer-encodings version in setup.py

Manual QA steps

Risks

Rollback steps

  • revert this branch

@hpatel41 hpatel41 changed the base branch from master to crest-master September 5, 2022 06:56
maximize_csv_field_width()
yield ('csv', csv.get_row_iterator(item, options=options))

def get_JSONL_iterators(iterator, options):

Choose a reason for hiding this comment

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

Add function doc string.

check_key_properties_and_date_overrides_for_jsonl_file(options, check_jsonl_sample_records)
return records

def check_key_properties_and_date_overrides_for_jsonl_file(options, jsonl_sample_records):

Choose a reason for hiding this comment

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

Add doc string for all the functions.

return (empty_file, samples)

def get_row_iterators_local(iterable, options={}, infer_compression=False):
"""Accepts an interable, options and a flag to infer compression and yields

Choose a reason for hiding this comment

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

Suggested change
"""Accepts an interable, options and a flag to infer compression and yields
"""Accepts an iterable, options, and a flag to infer compression and yields

@hpatel41
Copy link
Contributor Author

hpatel41 commented Sep 27, 2022

NOTE: The build is failing as we have mocked some functions from the singer-encodings library as per the new code, but the singer-encodings master does not contain those files and functions.

@@ -23,7 +23,7 @@ jobs:
name: 'Unit Tests'

Choose a reason for hiding this comment

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

Do update the singer-encoding version.

@@ -54,6 +58,28 @@ def generate_simple_csv_lines_typeC(self, num_lines):
lines.append([int_value, self.random_string_generator(), int_value*5, utils.strftime(start_datetime), int_value + random.random()])
return lines

def generate_simple_jsonl_lines_typeA(self, num_lines):

Choose a reason for hiding this comment

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

Add code comment for each function.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added comment for data generation functions.

@hpatel41
Copy link
Contributor Author

NOTE: The tap-tester tests shall not run on CircleCi as the SFTP host used for testing seems down. We ran all the tests in our local environment and the tests are passing successfully.

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.

3 participants