Skip to content

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
evekhm committed Jul 18, 2024
1 parent 73dae99 commit 7d78c65
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions classify-split-extract-workflow/classify-job/gcs_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,20 @@
# See the License for the specific language governing permissions and
# limitations under the License.

"""
Helper functions for interacting with Google Cloud Storage (GCS).
This module includes functions for downloading and uploading files,
adding metadata, retrieving lists of URIs, and writing data to GCS.
"""

import os
from typing import List, Tuple, Dict, Optional

from google.cloud import storage
from google.cloud.documentai_toolbox import gcs_utilities
from logging_handler import Logger
from config import START_PIPELINE_FILENAME, MIME_TYPES, PDF_EXTENSION, SPLITTER_OUTPUT_DIR
from google.cloud.documentai_toolbox import gcs_utilities

logger = Logger.get_logger(__file__)
storage_client = storage.Client()
Expand Down Expand Up @@ -152,9 +159,8 @@ def split_uri_2_path_filename(uri: str) -> Tuple[str, str]:
return dirs, file_name


def upload_file(bucket_name, source_file_name, destination_blob_name) -> str:
def upload_file(bucket_name: str, source_file_name: str, destination_blob_name: str) -> str:
"""Uploads a file to the bucket."""

bucket = storage_client.bucket(bucket_name)
blob = bucket.blob(destination_blob_name)

Expand Down

0 comments on commit 7d78c65

Please sign in to comment.